After Red Sox rally against Rivera, Yankees come back off Papelbon and beat Red Sox 4-3 in 10

On a night when Mariano Rivera and Jonathan Papelbon both failed to hold ninth-inning leads, Juan Miranda drew a bases-loaded walk from Hideki Okajima in the 10th that gave the New York Yankees a dramatic 4-3 win over the Boston Red Sox on Sunday night.

New York stopped a four-game losing streak that matched its season high. The Yankees cut the magic number to one for their 15th playoff berth in 16 years and closed within a half-game of AL East-leading Tampa Bay.

Boston lost for just the fifth time in 13 games, a key defeat in an improbable September run. Boston dropped 6½ games behind the Yankees in the AL wild-card race, and just seven games remain for the Red Sox.

Alex Rodriguez put the Yankees ahead 2-1 with his 29th homer, a two-run drive in the seventh off Daisuke Matsuzaka.

But Ryan Kalish and Bill Hall each stole two bases against Jorge Posada and Rivera as the Red Sox rallied in the ninth. Hall singled in the tying run and pinch-hitter Mike Lowell followed with a sacrifice fly.

That wasn't the end of the late drama, with Nick Swisher, Mark Teixiera and Robinson Cano singling off Papelbon in the bottom half as a light rain fell. Cano's hit drove in the tying run, but pinch-runner Ramiro Pena held at third. With the bases loaded, Papelbon held on by striking out Posada and retiring Lance Berkman on a flyout.

Then in the 10th, Curtis Granderson singled off Okajima (4-4) leading off, and Brett Gardner bunted. Catcher Victor Martinez's throw hit Gardner for an error that allowed Granderson to take third. Martinez appeared to get hurt on the play, but stayed in the game.

Derek Jeter was intentionally walked, Boston drew the infield in and pinch-hitter Marcus Thames grounded to third baseman Adrian Beltre, who threw home for the force.

Miranda then worked the count to 3-1 before taking an inside pitch for ball four.

Boone Logan (2-0) retired David Ortiz on a squibber down the first-base line for the final out of the 10th. Rivera blew a save for the fifth time in 37 chances — but third since Sept. 11. Papelbon blew a save for the eighth time in 45 chances.

With New York ahead 2-1, Jed Lowrie opened the ninth with a flyout to the right-field warning track, and Kalish singled off Rivera and stole second and third (the latter without a throw). New York brought the infield in, and with a 3-2 count Hall grounded a one-hop smash past Rodriguez's glove at third to drive in the tying run.

Hall stole second off Posada, as the crowd booed, then stole third as Posada bounced a terrible throw. Lowell, appearing for the first time since taking a grounder off his jaw Friday, flied to center as Hall scored.

Matsuzaka allowed four hits, walked one and struck out seven — five of them called. He had come in averaging 4.35 walks per nine innings but didn't have any until two outs in the eighth.

Rodriguez's opposite-field drive to right into the wind on an 0-2 pitch, was his fourth home run of the series and gave him 119 RBIs.

Before the seventh, Matsuzaka allowed two runners — both on singles — and just six balls out of the infield.

Mark Teixeira blooped a one-out, opposite-field single to left. Rodriguez, who had been 2-for-21 (.095) against Matsuzaka, took a strike, swung and missed, then lined a pitch into the first row of seats in right-center, where a fan dropped the ball back onto the field. When he realized it went over the wall, A-Rod pumped a fist as he rounded the bases.

After New York made a late switch and started Phil Hughes instead of Dustin Moseley, David Robertson relieved with two on and no outs in the seventh, then escaped the jam.

Kerry Wood allowed a leadoff single to Marco Scutaro in the eighth, and J.D. Drew hit what could have been a double-play grounder to second, only for Cano to make an offline throw that caused Derek Jeter to make a fine stretch for the catch.

Martinez struck out as a pinch-runner Eric Patterson stole second, and David Ortiz was intentionally walked. Rivera relieved and retired Beltre on a slow roller to second.

Boston scored in the third with some help from Swisher. Hall lined a ball into short right field and Swisher tried for a diving catch. When the ball landed in front of his glove and bounced past Swisher, Hall wound up on second with a double.

Lars Anderson's fly to center advanced Hall and, after Scutaro struck out and Drew walked, Martinez singled to right.

Hughes allowed one run and three hits in six-plus innings with four walks and four strikeouts. After Hughes walked consecutive batters starting the seventh, Robertson relieved. Kalish sacrificed and, with the infield in, Hall grounded to shortstop Derek Jeter. Robertson then struck out Anderson.

NOTES: Martinez has 21 RBIs in September. ... Teixeira made a neat glove pickup on Anderson's hard one-hopper in the fifth and stepped on first, starting a rare 3-6-2 reverse force double play. ... Lowell was held out of the starting lineup for the second straight game after taking a grounder off his jaw Friday. ... It was 69 degrees at gametime, a drop of 18 degrees from Saturday's first pitch. ... Kalish made a sprawling catch in left-center to rob Cano of an extra-base hit in the seventh.