BOSTON — Don’t look now, but the Yankees own the top spot in the AL wild-card race.
And in fitting fashion, they overtook the Red Sox in a wild 6-3 comeback victory that featured a huge go-ahead double from Aaron Judge and another titanic blast by Giancarlo Stanton.
The Yankees’ sixth consecutive victory moved them a game ahead of Boston — and two ahead of Toronto — for the one-game wild-card game.
“We aren’t afraid to make it interesting, that’s for sure,’’ Stanton said.
After the Yankees nearly blew the game in the bottom of the seventh thanks to a pair of Little League errors by DJ LeMahieu and Joey Gallo to extend the inning — leading to the Red Sox taking the lead — they stormed back in the eighth.
And Judge and Stanton’s decisive blows came against ex-Yankee Adam Ottavino in front of another sold-out crowd of 36,312.
Gio Urshela walked to lead off the inning, but pinch-runner Tyler Wade was thrown out trying to steal second when he appeared to slow up and made an awkward slide — which allowed Xander Bogaerts to scoop Christian Vazquez’s bounced throw and apply the tag.
LeMahieu walked and Anthony Rizzo belted a double to right-center, sending LeMahieu to third.
The Red Sox then went to Ottavino to face Judge with one out and runners on second and third.
With the infield in, Judge hit a foul pop that was nearly caught by Bobby Dalbec and then nearly struck out on a 1-2 pitch, but Vazquez couldn’t hang on to the foul tip.
On the next pitch, Judge drilled a two-run double to the gap in left-center to put the Yankees back up by a run.
“I thought I was done on the first foul ball that fell in foul territory,’’ Judge said. “I felt like a cat. I felt like I had nine lives up there.”
Judge dove head first into second and dislocated his left pinky, but stayed in the game and the Yankees are hopeful it isn’t serious.
Stanton followed with another titanic homer over the Green Monster — and out of Fenway — for a second straight game.
Chad Green allowed hits to Rafael Devers and J.D. Martinez to put runners on the corners with one out in the eighth. He got Dalbec swinging and Jose Iglesias on a soft liner.
The ending allowed the Yankees to overcome a nightmarish bottom of the seventh.
After right-hander Clay Holmes replaced Jordan Montgomery to start the bottom of the sixth and struck out the side, Holmes went back to the mound to start the seventh.
But when the Red Sox sent lefty-swinging Travis Shaw to pinch hit for Christian Arroyo, the Yankees countered by bringing in left-hander Joely Rodrigez.
The decision backfired, as Boston manager Alex Cora went back to his bench for the right-handed Jose Iglesias, who smacked a single to left off Rodriguez. Alex Verdugo followed with a slow infield hit and Rodriguez threw a wild pitch to move both runners up.
Vazquez hit a sacrifice fly to right to score Iglesias to tie the game.
Green entered to face the top of Boston’s lineup with Verdugo at second.
He got Kiké Hernandez looking before pinch-hitter Kyle Schwarber hit a foul pop that was dropped by LeMahieu for an error.
The inning unraveled further when Schwarber followed with a fly ball to left and Gallo dropped it for another error. Verdugo scored to take a 3-2 lead before Schwarber was thrown out trying to get to second.
“It was a weird couple plays,’’ LeMahieu said. “I don’t know how to explain it. I don’t think anyone does.”
After the Yankees rebounded and Green got through the eighth, Aroldis Chapman closed it.
“The story of our season is getting punched in the face and coming back,’’ LeMahieu said. “We’re used to it at this point.”
They have an off day on Monday before starting another key series in Toronto on Tuesday.
After dropping their first seven games against the Red Sox this season, the Yankees ended up going 9-10 against their rivals. If they finish tied for the wild-card lead, Boston would host the one-game playoff.
But after the Yankees completed their first three-game sweep at Fenway since 2015, the prospect of playing there again won’t be so daunting.