HOUSTON -- After making a ninth-inning error that helped the Royals beat the Astros in extra innings a day before, first baseman Lance Berkman made sure his team's defensive shortcomings weren't as costly Thursday afternoon.

Berkman hit a pair of go-ahead, two-run home runs and drove in a season-high four runs to surpass the 1,000-RBI mark for his career and help the Astros overcome three errors to beat the Royals, 5-4, at Minute Maid Park.

"That's good for my psyche after wearing the goat horns last night with that error," Berkman said.

Berkman recorded his first multi-homer game in more than a year by going deep in the second and sixth innings off Royals starter Brian Bannister to help Houston salvage the final game of the series and get within five games of first place in the National League Central.

The Astros' bullpen held the Royals to one hit and struck out seven batters in four innings, as Houston pitchers sent down 15 of the final 16 batters they faced. Wesley Wright (2-1) struck out four batters in 1 1/3 innings for the win, and Jose Valverde rebounded from Wednesday's blown save to record his sixth save.

"It was the 'Puma' and 'pen show," Astros manager Cecil Cooper said. "They were just outstanding. That's what Berkman needs to do, stay in left-center field. If he stays in left-center field, he's a player."

Astros starter Brian Moehler pitched five innings and gave up four runs, but the defense committed three costly errors behind him which led to three unearned runs.

"The last couple of days, we didn't field the ball too well, but today we overcame the errors, and Lance had a big game for us and picked us up and we pulled it out," Moehler said.

Berkman (3-for-4) was a bit harsher in his assessment of the defense.

"The defense has been terrible," he said. "It cost us the game [Wednesday] night, and today it could have cost us the game. We have to figure something out, a little more intensity and a little more concentration. You can't give teams extra outs in the Major Leagues and expect to win.

"We have been a good defensive team in the past, and there's no reason we can't be. This year, we just have to do it."

Berkman's two-run homer in the second inning -- which accounted for career RBIs Nos. 1,000 and 1,001 -- landed in the Crawford Boxes and gave Houston a 2-1 lead. Berkman became the third Astros player to reach 1,000 RBIs, trailing Jeff Bagwell and Craig Biggio.

"He was trying to hit everything that way, and obviously it's a short porch and I did a real good job with that lineup," Bannister said. "I allowed Carlos [Lee] to get on base in front of him, and I didn't make an adjustment. He had an approach on me and he executed it and he single-handedly beat me today."

The Royals took advantage of sloppy fielding in the fourth, scoring twice to take a 3-2 lead. Moehler got three ground balls to start the inning that should have resulted in three outs, but the first went off his leg for a single, and Jose Guillen and Mike Jacobs reached on consecutive errors by Jeff Keppinger and Miguel Tejada.

Moehler avoided more damage by getting Bannister to ground into a 1-2-3 double play to end the inning.

"It was big because that stopped the bleeding, I guess, and kept everything close," Moehler said. "That kept us in the game, and we were able to go ahead in the sixth inning."

Houston tied the game at 3 in the fourth on a sacrifice fly by Kaz Matsui, but a throwing error by catcher Humberto Quintero during a fifth-inning rundown -- costing the Astros the chance of an inning-ending out -- allowed a run to score to put Kansas City ahead, 4-3.

"It was a comedy of things," Cooper said.

Berkman followed a Lee walk in the sixth with another homer into the Crawford Boxes, putting Houston up 5-4. The Astros turned it over to their bullpen, which was terrific after blowing the lead Wednesday night.

Wright, pitching for the first time in a week, set a career high with his four strikeouts.

"I was able to locate my fastball better than in the past," Wright said. "My breaking stuff wasn't as sharp as it has been, but it was pretty good."

Chris Sampson threw two-thirds of an inning, and LaTroy Hawkins worked a scoreless eighth before turning the game over to Valverde, who converted his sixth save in nine opportunities this year.

"The bullpen did an outstanding job, particularly Wesley Wright," Cooper said. "He came in and threw strikes and attacked the zone. When we sent Wesley out [to Triple-A Round Rock earlier this year], we told him to throw strikes and he's done that. I know [Valverde] was happy to lock that one down."