The Celtics overcame a dreadful offensive first half and a 22-point Heat lead to secure their fifth straight win Friday night.

Derrick White’s corner 3-pointer with 1:31 remaining put Boston ahead for good in a 98-96 thriller over Miami at TD Garden.

Veteran newcomer Nikola Vucevic, acquired from Chicago for Anfernee Simons ahead of the NBA trade deadline, recorded a double-double off the bench in his Celtics debut, finishing with 11 points, 12 rebounds, four assists and two steals in 28 minutes.

Payton Pritchard, pushed from starter to sixth man after Simons’ exit, topped 20 points for the third straight game, scoring 19 of his 24 in the second half to help fuel Boston’s comeback. White shot 6-for-20 from the floor but scored 21 points and blocked four shots, including one in the final minute that would have tied the game.

Jaylen Brown led all scorers with 29 points on 11-of-25 shooting, offsetting his seven turnovers.

Up next for the 34-18 Celtics: a marquee matinee matchup against the rival Knicks on Super Bowl Sunday (12:30 p.m.). Boston has a one-game lead over New York for second place in the Eastern Conference.

The Celtics opened with a double-big lineup for the second straight game, sending out Neemias Queta and Luka Garza alongside White, Brown and Sam Hauser.

Previous Celtics teams heavily relied on multi-center units — last season’s played more than 1,200 minutes with two of Kristaps Porzingis, Al Horford, Luke Kornet and Queta on the floor — but they’ve been almost entirely absent from Joe Mazzulla’s game plans this season. Before Queta and Garza started together in Wednesday’s 114-93 romp over Houston, they’d shared the floor for just three total minutes. Garza had played an additional two minutes with rookie third-stringer Amari Williams.

The Queta-Garza pairing was highly effective against the Rockets, but much less so Friday night. After Boston quickly fell behind 9-2, Mazzulla lifted both bigs and inserted Vucevic and Pritchard, who’s come off the bench in each game since Simons’ departure.

Vucevic entered to a loud ovation from the Garden crowd and notched a steal, two offensive rebounds, two assists and a putback in his first seven-minute shift. But Bam Adebayo and the Heat frequently targeted the 35-year-old on defense as they built a 25-6 lead.

Head coach Joe Mazzulla placed some of the blame for his team’s sluggish start on his own “stupidity,” saying he overthought his game plan as he worked to integrate Vucevic. There also were some communication and timing breakdowns between the 35-year-old big man and his new teammates — unsurprising for a player in his position.

“I thought I kind of put the guys in a tough spot to start the game, just processing all the what-if scenarios,” Mazzulla said. “I thought we were just kind of bogged down by those things, and it kind of impacted it. Once we just simplified it, and once the game went on and we were able to see those reads, I thought the guys did a much better job.”

The Celtics also were bogged by wildly erratic shooting, especially from the perimeter. Brown and White shot a combined 1-for-11 from the field in the first quarter, and Boston started 1-for-21 from 3-point range, with Baylor Scheierman providing the lone make off a feed from Vucevic. The Celtics trailed 29-15 after their lowest-scoring opening period of the season.

Down 42-22 early in the second, Boston moved away from the three ball and leaned on interior aggressiveness from Brown. That shift gave the Celtics a bit of offensive momentum — Brown threw down a driving dunk out of a timeout, then scored on five of the next six possessions — but had little impact on the score line.

Miami’s lead never dropped below 17 points in the second quarter and was back to 21 by halftime, 59-38. At the half, Brown had 17 points, and no other Celtic had more than five. The veteran quartet of Brown, White, Pritchard and Hauser had attempted 16 threes and made none.

But just as they did in the teams’ previous meeting, when 39 points from Simons helped Boston erase a 19-point deficit in a Jan. 15 win at Miami, the Celtics roared back in the second half.

The Celtics’ Queta-Garza lineup opened the second half with a 6-0 run, and Brown finally ended Boston’s 3-point drought by drilling one at the 7:58 mark of the third quarter. That bucket seemed to unlock the rest of the Celtics’ offense.

Pritchard and White canned back-to-back threes, sandwiched around a White steal, to cut the Heat’s lead to 12. Another Pritchard triple after a Miami timeout, followed by an and-one scoop shot in the lane, made it a six-point game.

Boston then began feeding the new guy. Vucevic scored eight points in just over two minutes — six on layups, two on free throws he earned by drawing an offensive foul away from the ball — to get the Celtics to within one.

“I felt pretty comfortable out there,” said Vucevic, who met with Celtics coaches on Thursday for a “detailed walkthough” of the team’s system. “I think as the game went on, I think that the guys also felt more comfortable around me and were able to figure out certain things that they want us to run. I think for the first game, it was good. Obviously, we can continue to build on it and figure things out and get a feel of playing alongside each other out there on the court. Overall, I thought it went pretty well, and most importantly, we’re happy we got the win.”

A corner three from White closed the gap, tying the game at 72-72 with 40 seconds to play in the third.

The Celtics outscored the Heat 36-15 in the quarter, then built a five-point lead early in the fourth. Though Brown sparked the comeback, he watched much of it from the bench. Boston was plus-21 with Brown off the floor in the second half, including a 30-7 run.

Pritchard was the Celtics’ offensive engine during that stretch, giving them the same influx of off-the-bench scoring that Simons did three weeks earlier. After a five-point first half, he scored nine in the third quarter and 10 more in the fourth. In the three games since Simons was traded, Pritchard has scored 26, 27 and 24 points.

“I think Payton has just developed different aspects of his game,” Brown said. “Offensively, he’s always been able to be a three-point threat. He established that. But now I feel like learning to use his body, get to the midrange, get his shot off and be effective and efficient has helped take him to another step. Finding ways to get to the basket. He looks great. So he’s a big reason why we came back in tonight’s game. So being able to have him, get him going, etc. is a key part of our offense.”

White drew a three-shot foul and made all three free throws to put the Celtics ahead 91-89 with 4:49 remaining, then hit a 3-pointer from the same spot to make it 98-96 with 1:31 to play. Brown converted two tough bank shots in the final minutes, but his jumper in the lane that might have iced the game with 40 seconds to play was waved off for an offensive foul.

Davion Mitchell had a chance to push Miami ahead in the final seconds, but his 3-pointer from the left corner missed the mark, giving Boston its fifth straight win and eighth in its last 10 games. The Celtics will maintain that momentum through their final two games before the NBA All-Star break: the Sunday afternoon showdown with the Knicks and a visit from Simons and the Bulls on Wednesday.

“We’re a team,” Brown said. “… We like playing with each other. We play the game the right way, so that can carry you on the days that you might not be playing so well, or things might not be going your way. You’re always in the game, you’re always in the fight, when you play like a team, and we’ve been playing like a team all season. We haven’t skipped any steps, and regardless of who’s been out there, we’ve had that leadership carry over.

“So it’s been fun. It’s been fun. We still have a lot to learn, a lot to grow, but to be able to win while we’re doing that is a great sign.”