HOUSTON -- Brad Lidge couldn't completely keep the past out of mind.
So he pitched very carefully to Xavier Nady in the ninth inning, walking the pinch hitter before recording two strikeouts to preserve the Houston Astros' 5-4 victory over the Pittsburgh Pirates on Sunday.
"I didn't want to do anything that could possibly duplicate what happened the other times," Lidge said. "I just wanted to be smart."
The save came just two days after Nady hit a two-out home run in the ninth inning that blew a save for Lidge in a game Pittsburgh went on to win in 15 innings. And it was an almost identical scenario to the Astros' season-opener, when Nady hit a two-out homer in the ninth off Lidge to tie the game. The Astros lost that one in 10 innings.
"I wanted to be smart this time against him," said Lidge, who has 13 saves in 19 tries. "There's a reason he has done well against me. He's a good hitter. I was certainly aware of what he has done this year against me."
Ty Wigginton hit a two-run homer in the eighth inning as Houston rallied to avoid a three-game sweep.
The Astros trailed 4-1 before scoring twice in the sixth. Luke Scott then hit a one-out double in the eighth and Wigginton hit the first pitch he saw from reliever Shawn Chacon (4-4) to left field, his 19th homer of the year.
It was Wigginton's third home run since coming to the Astros in a July 28 trade with the Tampa Bay Devil Rays.
"I was just looking to drive one and get Luke in," Wigginton said. "It feels good to win it with a home run."
It didn't feel so good to the Pirates.
"It was a first-pitch slider," Chacon said. "I was just trying to get ahead of the batter. It wasn't the best slider, but it was a pitch he could handle and he handled it."
Mark McLemore (3-0) went two innings in relief of Wandy Rodriguez, allowing one hit with three strikeouts.
"The bullpen pretty much shut them down," Astros manager Phil Garner said. "Dave Borkowski and Mark McLemore did a nice job in getting it to Lidge, and Lidge threw some good pitches when he had to."
Houston took the lead in the first on an RBI single by Lance Berkman. One out later, Berkman ended the inning when he tried to score from second on a single by Scott. He was nabbed at home plate and Berkman argued the call, but Astros third-base coach Doug Mansolino interceded to avoid Berkman getting tossed.
Cesar Izturis' RBI single in the second inning tied the score at 1-1, and the Pirates went ahead in the third when Adam LaRoche hit a broken-bat, two-run single to left after Rodriguez had walked the bases loaded.
Pittsburgh made it 4-1 in the fifth on Freddy Sanchez's 10th home run of the season.
Houston closed within one in the sixth when Berkman singled and Carlos Lee doubled down the left-field line. Berkman scored on Scott's infield grounder, and after Franquelis Osoria relieved Tony Armas, Mark Loretta drove in Lee with a single.
Armas pitched 5 1/3 innings and gave up four runs on seven hits and a walk. He struck out three.
Rodriguez lasted five innings and allowed four runs on seven hits and three walks while striking out seven.
"This was a tough game to lose," said Pirates manager Jim Tracy, whose club still went 5-2 on its road trip. "I thought we did everything we could possibly do to win the game. They got a couple of big at-bats, and that's all it takes."
Jeff Bagwell had his No. 5 retired in a pregame ceremony Sunday. Then the game was played with three commemorative bases embossed with Bagwell's retirement ceremony on them. One was given to Bagwell and the other two will be auctioned off to the Astros in Action foundation. ... The Pirates lead the majors with 41 home runs this month, one ahead of the Yankees. ... Nate McLouth was caught stealing for the first time in 19 attempts, dating back to last season. His string was the third-longest in the majors behind Seattle's Ichiro Suzuki (24) and Arizona's Eric Byrnes (20). ... Lee's sixth-inning double was his team-high 37th.