The Red Sox kept opening the door for the Yankees, who refused to walk through it.
Clearly they were just waiting for the drama to be at its peak.
After Clay Holmes entered to grumbles but recorded the final two outs of the top of the 10th, Juan Soto delivered a walk-off single in the bottom of the inning to lift the Yankees to a 2-1 win over the Red Sox on Thursday night in The Bronx.
Leading off the inning against Red Sox reliever Josh Winckowski, Soto shot a line drive up the middle, past the dive of shortstop Trevor Story, scoring pinch-runner Jon Berti from second to give the Yankees their second straight extra-inning, walk-off win.
With the Orioles idle, the Yankees (85-62) extended their lead atop the AL East to two games with 15 games remaining.
The Red Sox (74-73), who are trying to keep their playoff hopes alive, dropped to 4 ¹/₂ games back of the final AL wild-card spot.
Soto’s game-winning hit was the Yankees’ first with runners in scoring position all night after they had gone 0-for-5 through the first nine innings and left nine men on base — eight of them by Anthony Volpe.
In relief of Nestor Cortes, the Yankees got strong work from Ian Hamilton and Tim Hill, who combined for three perfect innings to bridge the gap to the ninth.
Tommy Kahnle then worked around a double and a walk in the top of the ninth before Red Sox closer Kenley Jansen breezed through the bottom of the inning to send the game to extras.
Kahnle then got the first out of the 10th before Holmes quickly retired Ceddanne Rafaela and Jarren Duran to give Soto a chance to win it.
Making his first start back in the rotation after pitching in relief last Saturday against the Cubs — a move Cortes admitted he was “upset” about — the southpaw threw five innings of one-run ball while striking out nine and generating 19 whiffs.
The only damage came on a home run by Danny Jansen in the fifth inning, one of only three hits Cortes allowed in addition to three walks, which helped elevate his pitch count.
Whether Cortes did enough to stick in the rotation remains to be seen.
The Yankees are taking one turn as a six-man rotation but are expected to trim down to five by next week, with the odd man out likely moving to the bullpen.
Cortes threw 4 ¹/₃ no-hit innings in relief at Wrigley Field, but mostly picked up where he left off Thursday in a starting role.
Gleyber Torres gave the Yankees a 1-0 lead in the bottom of the first when he led off with an opposite-field home run off Cooper Criswell.
It marked Torres’ 13th home run of the season and continued a strong stretch out of the leadoff spot.
After mostly cruising through the first three innings, Cortes got himself into some trouble in the fourth when he walked Tyler O’Neill and Connor Wong in full counts with one out.
But Jazz Chisholm Jr. helped Cortes get out of it unscathed, fielding a hard chopper from Story, running to step on third and then firing to first for the double play.
The Yankees then loaded the bases with two outs in the bottom of the inning, but Volpe flew out to end the threat.
That stung in the top of the fifth when Jansen tagged Cortes’ slider down the middle for a home run that tied the game 1-1.
Rafael Devers struck out in all three at-bats he took against Cortes, but still found a way to impact the game with his defense.
With one on and one out in the fifth inning, Devers made a diving stab on a one-hopper smoked by Aaron Judge, then threw from his knees to second base to start an inning-ending double play.
The Yankees hurt themselves again in the sixth inning. Austin Wells was on second base, Chisholm on first and Jasson Dominguez at the plate when Wells took a big lead and almost looked like he was about to take off on the pitch.
But Chisholm thought he was going and took off for second, only to stop in his tracks and then get thrown out at first by Jansen.
Still, the Yankees ended up loading the bases with two outs again for Volpe, who again flew out to left field against reliever Zack Kelly.