NEW YORK — Little has been easy for the Miami Heat lately and little will be easy for the remaining two games of this trip, on Friday night against the Boston Celtics and Sunday night against the New York Knicks.

So if there was a moment for Erik Spoelstra’s team to make things right, to snap a season-worst five-game losing streak, this assuredly was it, against a Brooklyn Nets team that entered 7-18.

But just as the losing streak included a home loss to the now 6-20 Sacramento Kings, nothing was a given about this one.

And nothing was given by the Nets.

So with offense again a struggle, it took a late closing kick before the Heat were able to shed the skid, emerging with a 106-95 victory Thursday night at Barclays Center.

In what stood as a three-point game midway through the final period, the Heat finally put it away even with Bam Adebayo in foul trouble.

“It wasn’t, again, a stellar offensive game for us,” Spoelstra said. “But I think these are important. I think this is different. Our guys wanted it so bad.”

Norman Powell led the Heat with 24 points, with Adebayo contributing a season-high 17 rebounds. The Heat also got 22 points and 12 rebounds from Kel’el Ware, in his return to the starting lineup.

Mostly, the Heat offense was choppy and uneven, a night salvaged only at closing time, with Jaime Jaquez Jr. providing late scoring punch in his 19-point performance.

Those numbers helped the Heat overcome the 28 points of Nets forward Michael Porter Jr.

“Scoring 140 is great. Everybody loves it. It looks good. You’re breaking records, whatever it is,” Powell said of the Heat turning to their defense for salvation. “But we know it’s not going to happen every single night, especially in this league.”

Five Degrees of Heat from Thursday night’s game:

1. Game flow: The Heat pushed to an early 11-point lead, with that advantage down to 30-27 going into the second period. After the Nets briefly took their first lead in the second period, the Heat went into halftime up 54-49.

The Nets also went ahead in the third, before the Heat went into the fourth up 77-73.

It then got further dicey for the Heat when Adebayo was called for his fifth foul with 7:20 to play, leaving Spoelstra no choice but fourth-quarter trial by fire with Ware.

A pair of solid defensive possessions followed, staking the Heat to an 84-77 lead, with a Ware 3-pointer later helping put the Heat up 95-84, matching their largest lead to that point.

2. Ware again: With Tyler Herro missing a fourth game with a toe contusion, the Heat reverted to their big lineup, with Ware back in the opening mix alongside Adebayo, in a first five rounded out by Powell, Davion Mitchell and Andrew Wiggins.

Ware opened 4 of 4 from the field, also with four rebounds in that opening stint, consistently providing a scoring target at the rim.

Ware tied his career-best streak with a blocked shot in a 10th consecutive game, matching a streak from earlier this season.

“I feel like I had to step up,” Ware said of his performance.

Mostly significantly, he succeeded as closer.

“Bam felt that it was good too for Kel’el to have that opportunity to finish a game where there’s a little bit of context to it,” Spoelstra said. “So I think that’s all really important for his growth and improvement.”

3. Bam’s boards: For his part, Adebayo was up to 10 rebounds with 8:04 left in the second period, helping to compensate for a 1-of-7 start from the field.

Adebayo had 11 rebounds by the intermission, but only two points at that stage, missing both of his first-half free throws.

“You’re going to have those types of games,” Adebayo said. “Ball just won’t go in the rim. But it’s one of those games where you find a way to impact winning.”

Adebayo’s second conversion did not come until 53 seconds into the second half, amid yet another uneven offensive performance.

“It just shows you in this modern NBA, you can impact a win without having a 40-point game that everybody notices,” Spoelstra said. “That was about as impactful an eight-point game as you can have in terms of how it impacted winning, but also impacted a locker room.”

4. Powell play: Powell went from the injury report with calf soreness to 10 of the Heat first 19 points, opening 4 of 4 from the field, including 2 of 2 on 3-pointers.

Powell then was up to 15 points by halftime, including a 41-foot heave that beat the halftime buzzer, with three of the Heat’s seven first-half 3-pointers.

“I just take whatever shot is open,” Powell said of his successful heave. “But I always like to give myself a chance.”

Powell scored in double figures for the 25th consecutive game, the second-longest such streak of his career (35 in 2020-21 with Toronto and Portland).

Of Powell’s late relief baskets, Spoelstra said, “There were key moments in that second half where we just had a place for the ball to go.”

5. Jakucionis time: First-round pick Kasparas Jakucionis received the first rotation minutes of his career when he entered with 4:20 to play in the opening period, cast alongside point guard Dru Smith.

Jakucionis’ only previous NBA action had been 54 seconds of mop-up duty in the Dec. 1 home rout of the Los Angeles Clippers.

His first NBA points came on a 3-pointer with 2:10 to play in the opening period.

“I thought he gave us a good boost,” Spoelstra said.

Jakucionis’ night was limited to his 7:30 stint in the first half, with the 3-pointer his lone attempt.

Jakucionis’ time came with the Heat without Nikola Jovic and Pelle Larsson, as well as Herro.

“I’m trying to be ready always and do what I can do, control what I can control,” Jakucionis said. “And every time I have a chance, I’m trying to use it.”