NEW YORK — For all their sophisticated analytical brainpower, there is one set of numbers the Dodgers had not been able to make add up.

One short-season title in 11 seasons.

But the math has been reset. The Dodgers fought back from a five-run deficit and beat the New York Yankees 7-6 in Game 5 on Wednesday night, taking the eighth World Series in franchise history, the first since that “bubble” title in 2020 and — say it with me — their first full-season championship since 1988.

So many special moments were lost to the pandemic in 2020 — birthdays, weddings, graduations. The Dodgers reclaimed theirs, specifically the nine players from that team who participated in this year’s World Series. They will get their parade.

“We’re obviously resilient, but there’s so much love in the clubhouse that won this game today,” the Dodgers’ Mookie Betts said. “That’s what it was. It was love, it was grit. I mean, it was just a beautiful thing. I’m just proud of us, and I’m happy for us.”

In Dodgers lore, it will be remembered as a heroic comeback — the largest comeback ever in a World series-clinching victory — in Game 5, closed out by Walker Buehler cementing his big-game credentials. But it was one of the most horrendous defensive innings in World Series history that brought them back.

Unable to put the Yankees away with a bullpen game in Game 4 on Tuesday night and unwilling to go for a potential knockout blow by deploying their best relievers in a losing game (albeit one with a one-run margin in the middle innings), the Dodgers gave the Yankees the gift of life Tuesday night.

Held to just three home runs in the first three games, the major-league leaders in long balls hit three in Game 4 and three more in the first three innings of Game 5.

Dodgers starter Jack Flaherty has been both good and bad, alternately, during this postseason. The bad version showed up Wednesday night.

He walked the second batter he faced, Juan Soto, then gave up back-to-back home runs to Aaron Judge and Jazz Chisholm Jr. Flaherty gave up a leadoff double in the second inning and an RBI single to Alex Verdugo and Dodgers manager Dave Roberts brought out the Yu Darvish hook — the one that is both quick and too late at the same time. Darvish lasted just 10 batters in Game 7 of the 2017 World Series but five of them scored and the Dodgers couldn’t recover.

Roberts has said several times this year that the difference between this year’s Dodgers team and those previous teams that fell short of the ultimate goal was their willingness to fight.

Down 5-0 without a hit through four innings against Yankees ace Gerrit Cole, they fought.

Tommy Edman led off the fifth inning with a single. Then the bungling began.

Judge made a spectacular catch at the wall in the fourth inning, but he flubbed a line drive right at him for an error. Will Smith hit a ground ball to shortstop Anthony Volpe. He had the lead runner at third base but made a poor throw into the dirt and everyone was safe.

With the bases loaded and no outs, Cole struck out Gavin Lux and Shohei Ohtani and Betts dribbled a ball to first baseman Anthony Rizzo. The inning should have been over.

But Cole had stopped running to cover first base and could only watch helplessly as Rizzo, playing back, was too slow to beat the hustling Betts. The Dodgers’ first run scored and the inning went on.

World Series MVP Freddie Freeman drove in two more with a single to center field. His 12 RBIs in five games tied the World Series record (Bobby Richardson of the Yankees in the seven-game 1960 Series).

Teoscar Hernández followed with a drive to the wall in center field for a two-run double to tie the score. All five runs in the inning came after there were two outs — and should have been four.

“We just take advantage of every mistake they made in that inning,” Hernández said. “We put some good at-bats together. We put the ball in play.”

Brusdar Graterol walked three in the sixth inning and the Yankees regained the lead on a sacrifice fly.

But the Dodgers still had some fight in them. A broken-bat single by Kiké Hernández and an infield single by Edman started the eighth-inning comeback. Mix in a walk, a catcher’s interference and two sacrifice flies and the Dodgers emerged leading for the first time in the game.

Flaherty’s early exit turned Game 5 into yet another bullpen game, and Roberts had another night of antacid moments.

He trusted Blake Treinen to shut down the Yankees in the sixth inning then rode him through the seventh and eighth innings.

Judge doubled off Treinen with one out in the eighth and Chisholm walked. Roberts went to the mound with Treinen at 37 pitches.

“I looked in his eyes. I said how you feeling? How much more you got?” Roberts recalled. “He said: ‘I want it.’ I trust him.”

Treinen retired Stanton on a flyout and his 42nd pitch struck out Anthony Rizzo with two runners on to end the eighth.

It was a heroic effort — but Roberts needed another hero to get him three more outs. On came Game 3 starter Buehler who would have been throwing his between-starts bullpen session in preparation for a Game 7 start.

Instead, he retired the side in order in the ninth for his first major league save, and the Dodgers celebrated on the field at Yankee Stadium.

When Buehler struck out Verdugo to end the game, the Dodgers poured onto the field to celebrate between the mound and first base, capping a season in which they won 98 games and finished with the best regular-season record.

“There’s just a lot of ways we can win baseball games,” Buehler said. “Obviously the superstars we have on our team and the discipline, it just kind of all adds up.”

Ohtani, the Dodgers’ record-setting $700 million signing and baseball’s first 50-homer, 50-steal player, went 2 for 19 with no RBIs and had one single after separating his shoulder during a stolen base attempt in Game 2.