NEW YORK -- It was a night like so many others between the Yankees and Red Sox, back and forth, a bruising battle in which neither team would give in.
Alex Rodriguez hit a dramatic, go-ahead home run.
Then, Mariano Rivera blew a save.
And then, Jonathan Papelbon blew one.
Finally, Juan Miranda drew a bases-loaded walk from Hideki Okajima in the 10th inning that gave New York a dramatic 4-3 win over Boston on Sunday, one that moved the Yankees to the verge of another playoff appearance and just about ended the postseason chances of the Red Sox.
"It was a playoff atmosphere for us out there," Rodriguez said. "This was a huge game. There's no ifs, ands or buts about it. It was an enormous game for us -- especially as our last home game for a bit now. And again, I think it would have been devastating to lose a game at home like that."
New York stopped a four-game losing streak that matched its season high and cut the magic number to one for the Yankees' 15th playoff berth in 16 years. New York closed within a half-game of AL East-leading Tampa Bay.
"We still want to win our division. We still want to get home-field advantage, and we're fighting like crazy to do that," Yankees manager Joe Girardi said. "But it's a lot better feeling in that clubhouse tonight than it has been lately, that's for sure."
Boston lost for just the fifth time in 13 games, a key defeat in an improbable September run. The third-place Red Sox, who won the first two games of the series, have just seven games left and dropped 6 1/2 games behind the Yankees in the AL wild-card race.
"I think we came in and showed what kind character this team has," Bill Hall said. "We're going to try to win out."
New York made a late switch and started Phil Hughes instead of Dustin Moseley, and Hughes allowed one run and three hits in six-plus innings with four walks and four strikeouts. Victor Martinez had a two-out RBI single in the third after right fielder Nick Swisher failed to make a diving catch on Hall's leadoff liner, turning a single into a double.
Daisuke Matsuzaka allowed two runners -- both on singles -- through six innings and just six balls out of the infield. Mark Teixeira blooped a one-out, opposite-field single to left in the seventh and Rodriguez, who had been 2-for-21 (.095) against Matsuzaka, lined an 0-2 fastball into the first row of seats in right-center, where a fan dropped the ball back onto the field. Rodriguez's 29th homer was his fourth of the series and gave him 119 RBIs.
"He tried to get it in. He didn't get it in far enough," Red Sox manager Terry Francona said.
David Robertson had relieved Hughes in the top half and escaped a two-on, no-outs jam.
Then in the ninth, Ryan Kalish and Bill Hall each stole two bases against Jorge Posada and Rivera. Hall singled in the tying run and pinch-hitter Mike Lowell followed with a sacrifice fly. Girardi faulted Rivera for allowing big jumps.
"It was a huge game to win," Rivera said. "Unfortunately, it happened like this. Anyway, it was a win."
That wasn't the end of the late drama. Nick Swisher, Teixeira and Robinson Cano singled off Papelbon in the bottom half as a light rain fell.
Papelbon faulted plate umpire Phil Cuzzi for calling a ball on a 1-2 pitch to Teixeira, who singled on the next pitch. The reliever stared at the umpire after the key call.
"It was tough considering the fact that I was not only pitching against their lineup, I was also pitching against the ump," Papelbon said. "When you do that against this lineup, you are never going to be successful."
Then in the 10th, Curtis Granderson singled off Okajima (4-4) leading off, and Brett Gardner bunted. Martinez bolted out from behind the plate and made a leaping throw -- falling on his left knee -- but the ball hit Gardner for an error that allowed Granderson to take third.
Gardner might have been slightly to the fair territory side of the running lane.
"I didn't have time to see if he was in there, but I don't think so," Martinez said.
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.
"When I fell behind 3-1, I tried to be really fine with my pitch, but I let it sail a little bit and I walked him," Okajima said through a translator.
It was the fifth "walk-off" win for the Yankees, down from 15 during the 2009 regular season.
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.
"You know it's going be a fight until the 27th out," Rodriguez said. "Those guys over there have a lot of fight."
Martinez has 21 RBIs in September. ... It was 69 degrees at gametime, a drop of 18 degrees from Saturday's first pitch.