NEW YORK -- Opportunity after opportunity eluded the New York Yankees Wednesday night and even with the news the out of town scoreboard was providing, they were unable to celebrate.
New York's frustrating night ended when third baseman Deven Marrero drove in the go-ahead run and center fielder Mookie Betts added a two-run home run as the Boston Red Sox scored four times in the top of the 11th inning for a 9-5 victory.
By the time of Boston's 11th-inning rally, the Minnesota Twins and Los Angeles Angels already lost their games and the Yankees (86-72) merely had to win to celebrate. New York needs to win two games to clinch home-field advantage for the American League wild-card game.
"We're focused on winning the game," Yankees manager Joe Girardi said. "I've said all along our focus has to be winning games. And we need to win a game."
"I think we're looking forward to that (clinching)," New York closer Andrew Miller said. "We don't ever want to lose games. We're fighting. We're preparing like we have all year. We're a good team and we're going to get it."
Pushing across the winning run proved difficult for the Yankees, who stranded 15 and went 3-for-14 with runners in scoring position. They took a 5-4 lead on designated hitter Alex Rodriguez's 33rd home run with two outs in the sixth, but they squandered opportunities in the late innings.
"That's baseball," Girardi said. "I thought we swung the bats extremely well. They run a lot of balls down we hit extremely hard. Those two guys out there in center and left, they've been the difference maker."
The Yankees rallied from deficits of 3-0 and 4-1 but also blew a 5-4 lead when Betts homered in the seventh off Dellin Betances. They squandered opportunities by stranding two in the seventh and leaving the bases loaded in the eighth.
The eighth was when the Yankees may have scored the go-ahead run. They were unable to score despite getting four walks as center fielder Jacoby Ellsbury opened the inning with a free pass only to get caught stealing on a pickoff play by Tommy Layne and the eighth ended with left fielder Brett Gardner grounding out on the first pitch from Jean Machi.
After being unable to score against Alexi Ogando (3-1) and using their top three relievers (Justin Wilson, Betances and Miller), the game turned with runners at first and third when Marrero slapped a single up the middle off Andrew Bailey (0-1) and under the glove of second baseman Rob Refsnyder. Following a run-scoring sacrifice bunt by left fielder Jackie Bradley Jr, Betts hit a full count pitch from struggling left-hander Chasen Shreve over the left-field wall.
"We were aware there was the potential for them to clinch," Boston interim manager Torey Lovullo said. "We hung in there to hold off that celebration."
"I don't think we are necessarily trying to ruin hopes," Betts said. "I think we are just going out and playing the game, trying to win some games and I just that's kind of like a bonus. I don't think that's our first thought, but I think we're playing well and continue what we've been doing."
It was the third home run of the series for Betts and his second career multi-homer game.
While the Yankees sputtered offensively and are struggling to clinch the playoff spot, the Red Sox have an outside chance at finishing with a winning record after being 14 games under last month. They won for the ninth time in 12 games and did so despite issuing 11 walks.
"It wasn't pristine," Lovullo said after using seven relievers. "But when they needed to make a pitch, when they needed to pick each other up, they did a great job."
Before losing their third straight and ahead of Rodriguez's home run, the Yankees scored three times in the fifth on a ground-rule double by right fielder Carlos Beltran, a groundout by catcher Brian McCann and a single by left fielder Chris Young.
Both starting pitchers went five innings.
New York right-hander Masahiro Tanaka returned from a strained right hamstring and allowed a three-run home run to five baseman Travis Shaw with two outs in the third and an RBI single to designated hitter David Ortiz in the third.
Boston's Wade Miley allowed four runs and nine hits in five innings.
NOTES: In anticipation of the projected heavy rain, Baltimore and Philadelphia moved their respective Thursday games to afternoon starts. New York manager Joe Girardi said he was unaware of any plans to do the same with the Yankees' series finale Thursday. ... Yankees 2B Stephen Drew spent Wednesday consulting with concussion specialist Dr. Micky Collins in Pittsburgh. Drew said after Tuesday's game that he thinks he might be concussed. ... Boston OF Rusney Castillo missed his third consecutive game with an upper right quad strain. Manager Torey Lovullo said Castillo's condition is improving but not quite there yet. ... Lovullo also said 3B Pablo Sandoval (pneumonia) is improving, but it is too late for him to begin baseball activities.