Brad Ausmus, Geoff Blum and Michael Bourn went down, in order, against Takashi Saito to finish the game.
Wandy Rodriguez had a shaky five-inning start that left Houston with a five-run deficit.
Rodriguez said his curveball and breaking ball were both off Tuesday night. He gave up a two-run home run in the first to Russell Martin to start the trouble.
"I tried to throw my ball outside to Martin, but I missed in the middle," he said. "That was my problem tonight. I missed a lot on location."
Rodriguez gave up one run in the third, fourth and fifth frames, and Oscar Villarreal gave up another in the sixth, but the Astros came charging back in that inning as Lance Berkman walked and Miguel Tejada singled to center.
Ty Wigginton's sixth home run of the season scored three, and a two-run double in the next inning by Carlos Lee, scoring Berkman and Bourn, tied the game at 6.
"These guys keep battling; they don't give up," manager Cecil Cooper said. "That's all we can ask for is a chance to win the game, and we felt like we had a chance."
The Astros had a shot in the ninth to walk off with the win. Hunter Pence singled to second base to bring up Berkman with two outs. But the slugger flied out to center to end the inning.
They missed a shot in the 10th with Mark Loretta on first as Wigginton grounded out.
Houston left seven stranded on 10 hits in the nearly four-hour game. Although Cooper was pleased with his team's drive, the players were frustrated with the loss.
"I don't believe in moral victories," Bourn said. "Either you win or you lose. We're always going to have the fight in us, regardless. We're not ever going to give up in the course of the game -- we've just got that kind of mentalities as a team."
Rodriguez (3-4, 3.08 ERA) allowed five runs on six hits in five innings of work, striking out five while walking four. He threw 93 pitches.
Dodger starter Clayton Kershaw (0-2) was denied his first win of his career, and Saito recorded save No. 13.