PITTSBURGH (AP) – Preston Wilson’s singled in the go-ahead run in the 10th inning and the Houston Astros, down four runs in the ninth after losing in 18 innings the night before, rallied for a 5-4 victory over Pittsburgh on Sunday to halt a five-game losing streak.

Jason Bay homered in a sixth consecutive game and Jose Bautista hit a three-run shot, but the Pirates were denied their first three-game series sweep in almost two years when their bullpen squandered the four-run lead.

Pirates left-hander Oliver Perez dominated the defending NL champions for eight innings, allowing only three singles. But the Astros, after scoring only one run in 18 innings, scored four runs to tie it against Perez and relievers Mike Gonzalez and Salomon Torres.

Perez was allowed to start the ninth despite throwing 120 pitches to that point and quickly gave up singles to Morgan Ensberg and Mike Lamb. Gonzalez later walked Jason Lane and Willy Taveras to force in runs and also allowed Eric Bruntlett’s RBI single, and Torres gave up Brad Ausmus’ tying sacrifice fly.

Torres (2-2), pitching for the eighth time in nine games, then started the 10th by allowing consecutive singles to Ensberg, Lamb and Wilson, avoiding further scoring only when Lamb was tagged out at the plate as Bruntlett couldn’t put down a suicide squeeze bunt on an up-and-in pitch.

Chad Qualls (3-1) pitched a scoreless ninth for the victory. Brad Lidge, erratic of late in save situations, finished up in the 10th for his 13th save in 16 opportunities, stranding a runner on second to end the game.

The Astros avoided falling below .500 for the first time since they were 45-46 last season, before beginning the second-half run that led to the first pennant in franchise history. The Astros had lost 11 of 13 on the road, including an 8-7, 18-inning loss Saturday night in the longest game, by time, ever played in Pittsburgh – a 5 hour, 49-minute marathon that ended just before 1 a.m.

Bay didn’t look tired after an extended Saturday night in which he hit a three-run homer, made an excellent catch to prevent another homer and scored the winning run in the 18th.

Bay hit an 0-1 pitch from Fernando Nieve into the center-field bullpen area in the fourth inning, his 10th homer in as many games. The last two major leaguers to hit 10 homers in 10 games were Sammy Sosa (August 2002) and Shawn Green (May 2002).

Bay and Ensberg (April 15-21) are the only NL players to homer in six consecutive games this season. Texas’ Kevin Mench homered in seven consecutive games from April 21-28, one short of the major league record set by Long and later matched by Don Mattingly (1987) and Ken Griffey Jr. (1993).

That 1-0 lead held up until Jeromy Burnitz and Craig Wilson singled ahead of Bautista’s third career homer, on a 2-0 pitch by Nieve in the seventh.

Notes: Houston is 8-16 on the road and 2-5 on a road trip that wraps up with three games starting Monday in St. Louis. … The Pirates are 0-8 in home day games. … Pirates 1B Sean Casey, out for 21/2 months with two fractures in his lower back, could be activated as early as Monday. … Torres has pitched in eight of the Pirates’ last nine games. … The Pirates haven’t swept a three-game series since doing so against the Reds on July 23-25, 2004.

AP-ES-05-28-06 1647EDT