Oswaldo Cabrera of the Yankees celebrates with DJ LeMahieu after...

Oswaldo Cabrera of the Yankees celebrates with DJ LeMahieu after a game against the Red Sox at Fenway Park on Saturday in Boston. Credit: Getty Images/Brian Fluharty

BOSTON — Ultimately, the Yankees have to trade for some bullpen help, pronto. But in the meantime, what happened Saturday night at Fenway Park, where they were one strike away from another heartbreaking loss before tying it in the ninth and recording a dramatic 11-8, 10-inning victory over the Red Sox, well, that was pretty good, too.

A few hours after pulling off a trade with the Marlins for Jazz Chisholm Jr., the Yankees rode a career performance by Aaron Judge (4-for-4, two walks, homer No. 37, three RBIs), survived their battered relief corps and had Trent Grisham fight back from an 0-and-2 count to deliver the tying two-out double in the ninth against Kenley Jansen.

From there, the previously shaky Clay Holmes rebounded from Friday night’s blown save for two scoreless innings to help snap the Yankees’ three-game losing streak. They had lost 23 of their previous 33 games.

In the 10th, Austin Wells delivered a sacrifice fly and Gleyber Torres hit a two-out, two-run double to seal the victory. Given the circumstances, the Yankees’ mental state and the fact that this was the Red Sox at Fenway Park, Saturday night’s win was huge.

“We’re fighting for our lives right now,” Aaron Boone said. “That room is playing for a lot and you can feel it. Nothing’s been easy. We know we got to keep getting better and moving the needle and keep racking up wins.”

In the first two games of this series, the Yankees — who moved within one game of the AL East-leading Orioles — have scored 18 runs and picked up 30 hits to Boston’s 17 runs and 27 hits.

“When you come to Fenway, the place is rocking from the very first pitch all the way to the last pitch,” Judge said. “Even down to our last strike, when Grisham was battling there against Jansen, these are the games you want to play in. I don’t think the pitchers like it too much, but as hitters, you just love that back and forth.”

The Yankees came back from 5-4, 6-5 and 8-6 deficits and the Red Sox came back from early 3-0 and 4-3 deficits in a game that lasted 3:38.

Just like Friday, this was another stunning turn of events after the Yankees’ bullpen meltdown. After home runs by Juan Soto, Judge and Oswaldo Cabrera gave the Yankees two early leads, Jake Cousins surrendered a tiebreaking homer by Tyler O’Neill leading off the fifth — hanging an 0-and-2 slider — and after Ben Rice’s sacrifice fly tied the score at 6 in the seventh, it was Michael Tonkin’s turn to throw BP to the Sox in the bottom half.

Tonkin teed up O’Neill’s second homer on a 1-and-2 pitch, then sandwiched a hit-by-pitch between doubles by Dominic Smith and David Hamilton to hand the Red Sox an 8-6 lead.

The day after Judge awed the Fenway crowd with a 470-foot homer that provided a seventh-inning lead that was wasted by the bullpen, the Yankees’ captain reached base a career-high six times and finished a triple short of the cycle. Judge’s eighth-inning RBI double high off the Green Monster trimmed the Yankees’ deficit to 8-7, but Soto ran through Luis Rojas’ stop sign and easily was cut down at the plate.

In his last 69 games, Judge has 31 homers and 76 RBIs.

“He’s so consistent in who he is,” Boone said. “Forget how great a player he is between the lines and how great a hitter he is. But no matter what we’re going through — flying high or struggling our butts off — he’s the same focused, energetic team guy all the time. And that’s all I’ve ever seen from him.”

Marcus Stroman was handed leads of 3-0 and 4-3 in the first two innings but failed to protect either one and was gone before he could finish the fourth. Some of the damage wasn’t his fault — Anthony Volpe’s 11th error led to a pair of unearned runs in the second — and Stroman’s night ended after Torres seemingly whiffed on Jarren Duran’s 59-mph floater that turned into a double.

Stroman’s 3 1⁄3-inning, 60-pitch outing was easily his shortest of the season and stretched his winless streak to five starts. In the first two games of this series, he and Nestor Cortes allowed a combined 18 hits and nine runs in eight innings.

About 30 minutes after the Chisholm trade was officially announced, the Yankees set off some celebratory fireworks in the first inning on back-to-back home runs by Soto and Judge. Soto belted homer No. 27, a 400-foot drive into the rightfield stands, and two pitches later, Judge sent a 432-foot blast in the direction of the Citgo sign, giving the Yankees a 3-0 lead.

“Judge was special, as he’s been all year,” Stroman said. “Soto, obviously. Just a bunch of timely hitting from a bunch of the guys. Shout-out to everyone on the squad. It felt like a complete team win.”

But what looked like the early makings of a rout tightened up fast as Stroman was wobbly from the outset. The Red Sox quickly answered to tie the score at 3 in the bottom half, with Wilyer Abreu’s one-out homer followed by three straight hits, the last a two-run double by O’Neill.

Cabrera put the Yankees back on top in the second with his sixth home run, a long fly to rightfield that Abreu had in his glove before his tumble over the low wall jarred it loose.

That was just the beginning of a night that only got crazier the later it went on.

“They’re grueling when you go through them,” Boone said. “But these first two games of the series are kind of classic for being regular-season games.”

And for the Yankees, it feels much better to be on the winning side for a change.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME