NEW YORK - What was once lost became found again for the Red Sox in the Bronx Thursday night.
After coughing up a five-run lead in the seventh with some porous work by the bullpen, the Red Sox rallied against Mariano Rivera in the ninth, then won it in the 10th, edging the Yankees, 9-8.
Jacoby Ellsbury singled with one out in the 10th, stole second and just barely beat a throw from Ichiro Suzuki in right that catcher Austin Romine couldn't handle after a single by Shane Victorino.
The victory was the 21st for the Red Sox in their final at-bat.
In the ninth, a two-out single by Mike Napoli off Rivera, followed by a stolen base by pinch-runner Quintin Berry and a throwing error by Romine set up Stephen Drew to be the hero with a single to right.
Koji Uehara picked up his 18th save with his 26th straight scoreless inning.
It had looked pretty bleak for the Red Sox until then.
Leading 7-2 in the seventh, the Sox saw the Yankees rally for six runs off three Red Sox pitchers to overtake the Sox and re-ignite questions about the team's set-up relief.
Jake Peavy had limited the Yankees to two runs through the first six innings, but after throwing 104 pitches, was allowed to start the seventh.
After Peavy yielded a walk and a single, lefty Matt Thornton was brought in and allowed a walk and a single of his own before getting Robinson Cano to hit into a force play.
Junichi Tazawa then surrendered a run-scoring single to Alfonso Soriano, an RBI double to Curtis Granderson and a two-run single to Lyle Overbay to give the Yanks their first lead of the night.
The Sox had seemingly put the game away with a three-run fifth as Victorino led off with a homer before Mike Napoli delivered a run with an infield single and Ryan Lavarnway pushed another across with a fielder's choice.
Ellsbury had doubles home a run in the third and another one scored on a groundout by Victorino.
After the Yankees tied it with two runs off Peavy in the bottom of the second, Will Middlebrooks gave the Sox the lead again with a homer, his second in as many nights.
STAR OF THE GAME: Shane Victorino
Victorno knocked in three runs - the first on a groundout, the second on a solo homer and the last one in the top of the 10th when his line single to right delivered Jacoby Ellsbury with what turned out to be the game-winning run.
HONORABLE MENTION: Craig Breslow
After the Boston bullpen imploded in the seventh, Breslow came in for the eighth and tossed two scoreless innings, buying time for the Sox to battle back to tie it in the ninth and win it an inning later.
GOAT OF THE GAME: Mariano Rivera
Rivera was an out away from his 42nd save of the season, matching his uniform number. Instead, he gave up a line single to Mike Napoli, a stolen base to pinch-runner Quintin Berry and a blooper to Stephen Drew for his sixth blown save of the season.
TURNING POINT: In the top of the ninth, with the Sox trailing by a run, pinch-runner Quintin Berry stole second and went to third on catcher Austin Romine's throwing error. Berry then rode home on Stephen Drew's bloop single to right off Mariano Rivera
BY THE NUMBERS: The victory was the 21st for the Red Sox this season in their final at-bat.
QUOTE OF NOTE: "With this ballclub and guys that we have and the offense we have, there's not going to be many opportunites [to pinch run]. When I do get that opportunity, I try to make the most of it.'' --Quintin Berry on pinch-running.