HOUSTON -- It would be fair to say the Pirates bullpen had been hanging on a thread all series. With 11 innings of work on Friday and Saturday, the relievers had been taxed. And even though the 'pen hadn't allowed a single run in those 11 innings, the combined 16 Astros runners left on base during that stretch showed they hadn't been invincible.

The thread was bound to snap at some point, and when it did late in Sunday's game, it meant the difference between another series sweep of the Astros or a drop back into a tie for last place in the division.

"That's a tough game to lose," said Pirates manager Jim Tracy, after his team's 5-4 loss to the Astros in front of a third-straight sellout crowd at Minute Maid Park. "We did everything we could possibly do to win the game."

They did. And what was surprising in the way this one was lost is that it seemed the Pirates had already passed all the hard tests by the time the Astros strung together their eighth-inning comeback rally.

They had gotten through a start by Tony Armas, whose effectiveness this season has been a guess at best in each start he's made. On Sunday, he was mildly effective but enough to exit in the sixth with his team still leading.

Once the Pirates had successfully made it through Armas' start, there was inexperience to be reckoned with. Tracy had to turn to Franquelis Osoria, who had less than 60 innings of Major League experience, and Romulo Sanchez, who had none. Osoria allowed one inherited runner to score, and Sanchez's big league debut lasted a scoreless two-thirds of an inning.

So with the most questionable pieces having preserved the lead and the formidable trio of Damaso Marte, Shawn Chacon and closer Matt Capps waiting, the Pirates could smell a series sweep.

First came Marte, who embarrassed Lance Berkman with a quick three-pitch strikeout to end the seventh. He then opened the eighth with a strikeout of the always dangerous Carlos Lee. With the two right-handed sluggers out of the way and the left-handed-hitting Luke Scott up next, Scott seemed overmatched.

Marte came into the game having allowed just one hit against the last 35 left-handed batters he faced. Scott, however, worked the count full and launched a ball into center that nearly cleared the fence, but Scott settled for a double.

Reflecting on the pitch sequence afterward, Tracy wasn't so sure Scott should have ever seen that 3-2 pitch from Marte.

"I do know this, that 2-2 pitch to Luke Scott was awfully close," Tracy said. "Awfully close. Very close."

Chacon took the ball from Marte to face Astros third baseman and former Pirate Ty Wigginton, and Wigginton sent a first-pitch slider into the Crawford Boxes that proved to be the eventual game-winner.

"First pitch, I'm trying to get ahead of him," said Chacon, who dropped to 4-4 on the season. "It wasn't the best of sliders, but I think he was looking for it. It was a pitch he could handle and he was looking for it. And he did."

The Pirates showed a spark of life in the ninth against closer Brad Lidge, but pinch-hitter Xavier Nady couldn't repeat Friday night's heroics and Jose Bautista struck out to end the game with the tying run standing at second.

"You can't let one pitch take away from the whole game," said Chacon, lauding his team's performance Sunday and in recent weeks. "Lucky for them it was at the right time. That's the end of it. You can't take away from the way we've been playing. We've been playing great baseball."

There's no denying that. With seven wins in the last nine days, including a 5-2 road swing and three straight series wins, the Pirates have been one of the Majors' hottest teams. So even after a disappointing loss, this isn't one they are going to let sting too long.

Offensively, the Pirates twice came through with clutch two-out RBI hits. Cesar Izturis knocked home the Pirates' first run with a two-out single in the second to tie the game before Adam LaRoche put the Pirates ahead the following inning with a two-run single that landed just beyond the infield dirt.

In the fifth, Freddy Sanchez knocked his 10th homer of the season that extended the Pirates' lead to 4-1. From there, however, a Pirates offense that leads the Majors in runs scored this month couldn't muster another in the final four innings.

As for Armas, his spot in the rotation still remains in question. His outing may not have even lasted 5 1/3 innings if it hadn't been for a well-set block of the plate and a slick tag by catcher Josh Phelps -- who was making just his 10th career appearance behind the plate -- that prevented Berkman from scoring and limited the Astros to just one first-inning run.

Despite the loss, the Pirates have still won nine of 12 against the Astros this season, and five of six on the Astros' home turf.

"We played a very good baseball game," Tracy said. "We just got beat to the credit of the opposition. That's all."