HOUSTON — Carlos Lee's first home run of the season came at the perfect time.
Lee's two-run shot in the ninth inning propelled Houston over the Arizona Diamondbacks 4-2 Wednesday night and ended the Astros' eight-game losing streak.
"It was great, a great feeling, especially to come back and win that game," Lee said.
Kaz Matsui drew a leadoff walk before Lee sent a long drive over the train tracks in left field off Juan Gutierrez (0-4).
"He made a mistake," Arizona manager A.J. Hinch said. "The leadoff walk didn't dictate the home run, but it certainly rose the tension in the situation and Lee went up and ambushed him pretty much with the first-pitch fastball."
Lee averaged nearly 30 homers and more than 100 RBIs in his first three years with Houston. This home run came in his 100th at-bat of the season — the three-time All-Star slugger began the day hitting just .198.
He said he was frustrated by his lack of production earlier this season, but that he'd been feeling better lately.
"At the beginning I was because I was striking out a lot," he said. "I wasn't making good contact. But I've been swinging the bat pretty decent lately and unfortunately it hasn't showed much on the average."
Astros closer Matt Lindstrom (1-0) gave up back-to-back singles with one out in the ninth, but got out of the jam when Kelly Johnson grounded into a double play.
The Astros hope the stirring win can help them get back on track. They've had two eight-game losing streaks in their first 27 games this season.
"We needed that bad," Michael Bourn said. "Even though it's just one win, we just needed to get that going. To have a win like that in that fashion ... was great."
Starting pitchers Rodrigo Lopez and Brett Myers each gave up two runs in seven innings.
Lopez yielded a season-low three hits and struck out four before Aaron Heilman took over for the eighth.
Tommy Manzella's first career home run — a two-run shot to left field — put Houston ahead 2-1 in the second. It broke a streak of five straight games without a home run for the Astros and gave them double the runs they'd managed in the previous two games combined.
"The pitching has been doing a really good job and we haven't scored the runs and that's been the problem there," Lee said.
Lopez retired 13 of the next 14 batters after the homer. He walked Lance Berkman in the seventh inning before Hunter Pence grounded into a double play.
Myers got some help from center fielder Bourn in the seventh inning. Bourn sprinted almost to the wall in right-center field to snag a fly ball hit by Johnson for the first out.
Bourn then slipped and fell as he was chasing a fly ball by Stephen Drew, but managed to stretch his glove out just enough to catch that one, too.
"He made two great plays," Myers said. "The fans appreciated it. I appreciated it and that's what good center fielders do and he's one of the best."
Myers gave up six hits and struck out six before Brandon Lyon pitched a perfect eighth inning.
Arizona took the lead in the second when Gerardo Parra hit a run-scoring triple that hit just above Lee's head on the wall in left field.
Parra added an RBI double in the fourth that made it 2-all.
Wednesday was Arizona's 10th straight game on the road and Hinch thought it was wearing on his team.
"We were a little dead early and I wasn't expecting it," he said. "Everyone is going to go through these three-city tours, but we're pros, we need to step up and do our jobs. Yes, it's been long. Yes, it's been taxing. Yes, we've lost some close games, but that doesn't give us an excuse to come out flat or miss our opportunities."