Leading 4-2 in the fourth set, he dived to his right to produce a volley that Almagro was unable to return to go 30-15 up and rouse the crowd with chants of "Radek, Radek" echoing around the arena.
"It was an important moment," said Stepanek, who turns 34 later in November. "It gives us a great motivation for the next season."
Playing in his first final, Almagro said he learned a lot despite losing to Stepanek and Berdych.
"It was a fantastic experience," Almagro said. "It's a pleasure for me to be part of the team."
The victory was a sweet revenge for the Czechs after they were swept 5-0 by Spain in the 2009 final in Barcelona
Earlier Sunday, David Ferrer kept alive Spain's hopes of winning a fourth Davis Cup title in five years by beating Berdych 6-2, 6-3, 7-5 in the first reverse singles match to tie the final at 2-2.
Ferrer is wrapping up the best season of his career with a tour-best seven tournament titles. He converted his first match point for his 76th win of the year when Berdych's forehand hit the net, bringing cheers from the boisterous section of Spanish fans.
"We're sad at this moment," Ferrer said after Almagro's loss. "I'm very proud of our team. We were fighting to win here in Prague."
The Czechs beat Italy, Serbia and Argentina en route to the final. Spain, without the injured Rafael Nadal, had been looking for its sixth title.
Outpatient ROBOTIC HYSTERECTOMY. Trust an experienced Robotic Surgeon.