HOUSTON -- Philadelphia's recent surge was slowed by an unlikely foe.
Pinch-hitter Jed Lowrie delivered a two-run double in the eighth inning and the lowly Houston Astros stung Philadelphia, rallying for a 6-4 victory Thursday night that ended the Phillies' seven-game winning streak.
That run had pushed the Phillies within three games of St. Louis for the second NL wild-card spot.
"The percentages in baseball, sooner or later you are going to get beat," Philadelphia manager Charlie Manuel said. "At the same time, I didn't mean for it to happen tonight. We had a chance to win the game, it was sitting right in front of us. The bottom line is that we didn't add on runs, but we didn't execute either."
Philadelphia couldn't hold an early 4-0 lead. Lowrie's two-out hit put the Astros ahead 5-4.
"We had opportunities and Lowrie got a big hit for him," Philadelphia's Ryan Howard said.
Matt Dominguez hit a three-run homer for Houston, which has the worst record in the majors.
Philadelphia's bullpen had pitched four scoreless innings after an early exit by starter Tyler Cloyd before running into trouble in the eighth.
Phillippe Aumont (0-1) took over in the eighth with a 4-3 lead and walked Jason Castro with one out. Pinch-runner Jordan Schafer was caught stealing on a strong throw by catcher Erik Kratz from his knees.
But Aumont walked Dominguez and plunked pinch-hitter Scott Moore on the foot.
Aumont pitched in both games of a doubleheader on Sunday and in each of the last three games.
"That is a lot of pitching for him, and I did feel like he was out of gas," Manuel said. "The more he stayed out there, you could see that he didn't have the stuff he had yesterday."
Jake Diekman, the fifth Phillies reliever of the game, gave up Lowrie's hit that stopped a string of 21 consecutive scoreless innings pitched by Philadelphia's bullpen.
Brandon Barnes pushed the lead to 6-4 with an RBI single.
Wesley Wright (1-2) got the last two outs of the eighth for the win. Wilton Lopez allowed a hit in a scoreless ninth for his fifth save.
For the Astros, it was a bright spot in this mostly dreadful season.
"There's a lot of satisfaction in that," Wright said of beating a team in post-season contention. "They come with a lot on the line and we have a chance to kind of derail that and finish the season on a positive note. So it's a good victory all the way around."
Kratz broke an 0-for-16 skid with an RBI double to give Philadelphia a 1-0 lead in the second.
The Phillies scored three times in the third. Juan Pierre and Chase Utley hit consecutive one-out singles and Howard had a sacrifice fly. John Mayberry Jr. and Kevin Frandsen added RBI singles.
Justin Maxwell and Castro hit consecutive singles in the fourth before Dominguez's shot. The drive broke an 0-for-13 streak for Dominguez and was his third three-run homer in the last seven games.
Houston starter Lucas Harrell allowed seven hits and four runs in 5 2-3 innings to remain winless since Aug. 14.
Pinch-hitter Pete Orr singled with two outs in the sixth and Harrell issued consecutive walks to load the bases. Harrell was lifted after the second walk, and jawed at plate umpire Bill Miller on his way to the dugout and was ejected.
"The competitiveness of wanting to win kind of got a hold of me today and I let my emotions run a little bit," Harrell said, adding that he thought he pitched "horrible."
He was replaced by Xavier Cedeno, who retired Utley to end the threat.
Cloyd yielded five hits and three runs in three-plus innings.
Cloyd retired his first six batters before Jimmy Paredes singled to start the third. Jose Altuve hit a two-out single and Cloyd hit Fernando Martinez with a pitch to load the bases before getting Brett Wallace on a grounder.
It was the second tough start for Cloyd, who had his contract purchased from Triple-A Lehigh Valley on Aug. 29. He allowed eight hits and four runs in four innings of his last start, but received a no-decision.
NOTES: Frandsen was back in the lineup after missing seven starts with a sore left ankle. ... Houston's Bud Norris was scratched from Friday's start because of a blister on the index finger of his pitching hand. The Astros have a six-man rotation, so each pitcher will simply be moved up a game. RHP Edgar Gonzalez will start on Friday against Philadelphia LHP Cole Hamels. ... Astros reliever Mickey Storey was OK a day after being hit on the side of the face by a line drive which glanced off his hand and shoulder before striking him in the face. He said before the game that he's a bit sore but feels lucky that the injury wasn't worse.