Updated

Jacoby Ellsbury's third homer of the day on Sunday rescued the Red Sox and kept them in the wild card lead.

Ellsbury's three-run blast off Scott Proctor in the 14th inning boosted Boston to a 7-4 win over the AL East-champion New York Yankees in the night portion of a doubleheader.

Ellsbury hit a pair of homers in a 6-2 loss in the afternoon contest, but his 31st of the year was huge considering Boston is now one game ahead of Tampa Bay for first place in the wild card standings. The Rays won at home over Toronto Sunday afternoon.

The Red Sox, who are 6-18 in September, were in first place in the AL East coming into the month. They have won just four of their last 18 games. Just prior to the brutal stretch, going into September 7, they owned an eight-game lead on the Rays in the wild card standings.

"A lot of people are writing us off, so we're going to come out and play our butts off," Red Sox second baseman Dustin Pedroia said.

It comes down to the final series, and possibly a fourth game should the Rays finish in a tie with the Red Sox. The Angels are still alive too, barely, three games behind the Red Sox.

Boston heads to Baltimore to conclude the season, while the Rays host the Yankees and the Angels welcome AL West-champion Texas.

Boston's bullpen allowed just one hit over the final eight innings, helped by Jonathan Papelbon's four strikeouts over 2 1/3 frames. That included striking out Austin Romine with the bases full to end the ninth.

Pedroia made a head-first dive what was ruled an infield single in the 13th, but replays showed he was out with Nick Swisher making a nice scoop on a low throw from third baseman Ramiro Pena.

"I don't think Swish was showing him up," said Yankees manager Joe Girardi, who was then ejected for arguing the call made by first base umpire Tim McClelland. "That's always the big thing, the relationship with the umpires and players. You could have your say, but don't show us up. I thought he went at Swish and I didn't think that was right. Pedroia was clearly out."

Franklin Morales (1-1) fanned Brett Gardner to leave a runner at third in the 13th.

Pinch-hitter Darnell McDonald grounded a one-out single into left field in the 14th against Proctor (0-2). Marco Scutaro walked and runners were at the corners after Jarrod Saltalamacchia flied out to center. Ellsbury then smacked a 1-0 pitch into the bullpen beyond the wall in right-center.

Felix Doubront had a 1-2-3 14th to secure his first save of the year.

The Red Sox, who snapped a four-game slide, fell behind 3-0 in the first inning with John Lackey facing big trouble early. He walked Curtis Granderson with one out and Robinson Cano singled. Mark Teixeira then hit a two-run double high off the wall in center field. After receiving the throw at the plate, Jason Varitek tried to get Teixeira going to third, but deposited the ball in left field, giving New York a three-run cushion.

Ivan Nova, who remained unbeaten in his last 16 starts (12-0), gave up a triple and an RBI single to J.D. Drew in the fifth. Drew, hadn't played since July 19 due to a left shoulder impingement,

Adrian Gonzalez grounded out to plate Carl Crawford in the sixth to tie the game. Dustin Pedroia then tried to score from third on a wild pitch, but the ball took a great bounce right back to Romine. He tagged out Pedroia, who leaped over the catcher and the plate.

Scutaro and Varitek had run-scoring hits in the seventh inning, but the Yankees tied it in the bottom half after chasing starter John Lackey. Chris Dickerson's sac fly plated Gardner.

Game Notes

The Yankees finished the season 6-12 vs. Boston...New York recorded just two hits over their final 45 batters of the game, following Romine's second-inning single and finished 5-hour, 11-minute game with All-Stars Derek Jeter, Alex Rodriguez, Andruw Jones and Russell Martin on the bench.