BOSTON — In the eighth inning at Fenway Park on Wednesday, there was no question that the Red Sox were in last place in the AL East and there was no threat of catching the Yankees in the standings.
Instead, Boston came close to stealing a win from the Yankees with a late rally by Jonathan Loiciga.
But in the innings game, the Yankees rallied 5-3, their fourth straight victory over the second-place Blue Jays to extend their six-game lead over Tampa Bay.
With the lead tight in the bottom of the eighth, J.D. Martinez beat Gleyber Torres’ throw early and seemed to avoid blowing the Yaks’ lead. . But the Yankees contested the game and replays showed that Martinez stepped in front of the plate and never touched the bag, and was ejected from the game.
Clay Holmes allowed a run for his third straight outing, but the Yankees held on in the ninth.
In front of a sellout crowd of 36,581 at Fenway Park, the Yankees finished off the last-place Red Sox in their last regular season meeting.
And while Aaron Judge was held to 57 homers, they got enough offense from a weakened lineup, as Nestor Cortes returned from a strained groin to give up just one run in five-plus innings in his second start.
Torres won another productive game at home.
The second baseman’s revival continued with an RBI single that led to the Keystone Kops’ home run as three errors led to four unearned runs.
Aaron Hicks reached on an error in the fifth when Xander Bogaerts couldn’t handle a hard-hit grounder up the middle.
Judge followed another sharp grounder, Bogaerts stopped with a diving play, but went for an infield single.
Giancarlo Stanton struck out for the third time on the night and Torres singled to drive in Hicks, then Connor Wong singled out Alex Verdugo in right field and threw the ball to right field in an attempt to get Torres out.
The referee allowed him to score easily and the mischievous Torres rounded the ball and slid safely home.
Torres was instrumental in the Yankees’ final run of the night, when Abraham Almonte misplayed a long fly ball in the top of the ninth that allowed Tim Locastro to pinch run for Stanton and score.
After a six-pitch first inning, Cortes gave up a leadoff double in the second to Rafael Devers and then walked Martinez.
But he recovered and made Rob Refsnyder fly to the right, Kiki Hernandez popped up to clear the threat. Pop-up.
Cortes rolled after second and retired all nine at one point — including hits on the side by Bogerts, Devers and Martinez in the fourth.
Boston came back in the bottom of the fifth on Wong’s double into the left field corner that scored Reifsnyder.
Jose Trevino rose above the Green Monster on the left side and scored Kiner-Falefa to make it 4-1.
Cortes Verdugo walked to start the sixth and Clark Schmidt came in to strike out Bogart, Devers and Martinez.
Loiciga replaced Schmidt in the eighth and gave up back-to-back singles to left fielder Rhys McGuire and Tommy Pham. Verdugo grounded out and Bogarets hit a batter to right to load the bases.
Marwin Gonzalez then scored on Pham to make it 4-2 before Martinez grounded into a double for Devers.