Taylor Buchholz (6-6) pitched six solid innings for Houston and Brad Lidge got four outs to earn his 21st save and 14th in his last 15 opportunities. Shortstop Adam Everett made two nice plays in the ninth to finish off the Cardinals.
"We played a very sound, solid defensive game," Houston manager Phil Garner said.
Jim Edmonds homered for St. Louis, which lost for the 10th time in its last 11 road games. Edmonds led off the seventh against reliever Chad Qualls with a liner off the wall in right, but Berkman gunned a perfect strike to Craig Biggio for the putout at second. Earlier, Berkman threw out Scott Rolen at third as he tagged up following Edmonds' flyout.
"My philosophy is just to get it on its way and hope it lands somewhere in the vicinity of the base," Berkman said. "That worked out twice tonight."
Berkman is the lone Astro on the NL All-Star roster and he'll compete in Monday's Home Run Derby. He doesn't mind being known for his bat more than his glove.
"All I can do is keep making plays," he said. "I'm not sitting up nights thinking, 'I hope somebody thinks I can play defense.'"
A fielding gaffe by Cardinals second baseman Aaron Miles,
meanwhile, fueled the Astros' go-ahead rally in the fourth.
Chris Burke walked to lead off and Berkman was hit by a pitch. A run scored when Miles couldn't handle Preston Wilson's groundball. After a walk, the second run scored on a double-play grounder by Morgan Ensberg.
The Cardinals' starting pitchers had an 8.30 ERA in their last 15 games and Sidney Ponson (4-4) looked like he might be in for a rough night when Lamb hit his eighth homer to right in the first. Ponson did not allow a home run in his last five starts.
But Ponson pitched well after that, lasting six innings and giving up only three more hits.
"Sid pitched well enough to win," Rolen said. "We're not putting runs on the board and it's not a good formula. It's something we've got to turn around."
Ponson seemed most disappointed with the walk to Burke that started the Astros' two-run fourth.
"It's my fault to walk the leadoff guy," he said. "Percentage-wise, they always come around to score."
Buchholz, meanwhile, wasn't as sharp as he was in his last start, when he allowed two hits in seven innings in a 7-0 win over Texas.
He beaned Cardinals catcher Yadier Molina leading off the third and Molina was replaced by Gary Bennett. Molina suffered a mild concussion and St. Louis manager Tony La Russa said it was doubtful he would play on Friday.
With one out in the fourth, Albert Pujols smashed a hard single to left and Edmonds followed with his 10th homer. Berkman didn't move as he watched the towering blast sail into the upper deck, putting the Cardinals up 2-1.
Buchholz allowed three hits and struck out three and retired seven of the last eight Cardinals he faced. He's been bothered lately by soreness in his right middle finger and said it flared up again Thursday.
"I just put it out of my mind," he said. "A couple of times, it did hurt me, but I just quit thinking about it."
Ensberg and Everett led off the seventh with singles and La Russa replaced Ponson with Josh Kinney. Ponson walked four and struck out four.
Pinch-hitter John Rodriguez led off the eighth with a double off Astros reliever Dan Wheeler. David Eckstein bunted Rodriguez to third and Wheeler struck out Chris Duncan before intentionally walking Pujols. Lidge came on and Rolen lined out to end the threat.
Wilson capped the scoring with an RBI single in the eighth before Everett threw out Edmonds and Bennett in the ninth on grounders deep in the hole.
"When he's behind you," Lidge said of Everett, "pitchers feel a lot better, just knowing he's there."
The Cardinals have lost 13 of their last 16 games. ... Buchholz has won three of his last four starts after three consecutive losses. ... Edmonds' 220th career homer tied him with Mark McGwire for fifth place on the Cardinals' all-time list.