Knicks forward Julius Randle is assisted by a trainer after...

Knicks forward Julius Randle is assisted by a trainer after injuring his shoulder in the fourth quarter of an NBA game against the Heat at Madison Square Garden on Saturday. Credit: Kathleen Malone-Van Dyke

With the Knicks running away with the game in the fourth quarter, the celebration already was starting. Any win over the Miami Heat is cause for the crowd at Madison Square Garden to raise the noise level.

And then it all changed.

Julius Randle drove to the basket with 4:27 remaining in a one-sided game, falling awkwardly as Miami’s Jaime Jacquez Jr. stepped in front of him to try to draw a charge. Randle went headfirst toward the floor, extending his right arm and crashing in a heap. He got up and immediately went to the training staff and then the locker room, and a league source confirmed that he had suffered a dislocated right shoulder.

While the Knicks finished off a 125-109 win, with chants of “MVP!’’ for Jalen Brunson still rising as the benches were emptied in the final minutes, Randle headed to the hospital for an MRI and the Knicks awaited word on how long they might be without their two-time All-NBA forward.

Randle rarely sits out, and it is even rarer that he allows anyone to see him in pain. But this time it was obvious to the fans in the farthest reaches of the Garden and certainly to his teammates. Leaving the floor immediately without shooting his free throws meant he was done for the game and that it was a serious problem.

“It was an ‘oh [expletive]’ reaction,” Brunson said. “Yeah. You don’t want to see that from anybody. Especially the way he’s been playing. He means a lot to us. So for him to go back there, obviously it’s not ideal. When we figure out what’s wrong, we’ll go from there.’’

“I love Julius,” coach Tom Thibodeau said. “I know he’s going to give us whatever he can. That’s the best part of him. He has a very high pain tolerance. He’s a great worker, loves the game. It’s unfortunate . . . You knew for him to do that — he’s a guy who plays through things, and that’s what you love about him. He’s a warrior. And so, any time someone walks back, you know it’s something.”

Asked how concerned he was, Thibodeau said, “Very. You’re concerned any time someone gets hurt. You hope for the best. That’s where we are right now. But I also feel that if he’s out, next guy get in there and get it done.”

The Knicks did that on this day. They were up 17 at the time of the injury and stretched the lead to 22 before the benches played out the final minutes. But that was a short- term win when the big picture is the status of Randle, who was a strong possibility to be added to the Eastern Conference All-Star team next week in the coaches’ voting. He’s averaging 24.0 points, 9.2 rebounds and 5.0 assists per game this season.

The Knicks have won six straight and the Heat have lost six straight. And the “MVP!’’ chants for Brunson after a 32-point, eight-assist effort were loud, but it was hard to make more of this January win when it came at a cost.

Brunson recalled suffering a dislocated shoulder in his second season with Dallas. That came on Feb. 22, and with the pause in the season, he still did not even return for the playoffs in the final days of August.

“It popped back in when I rolled up off the ground,” Brunson said. “It was painful. Can’t lie. I shot my free throws, though. I didn’t walk off the court.”

Asked how long he was sidelined, he just said, “Long.”

The Knicks already were talking next-man-up but were pleased to finish off their rivals. It’s worth remembering that the Heat had the same record after 45 games last season that they did entering Saturday’s game — 24-21 — and eventually went from the play-in round to the NBA Finals. They beat the Knicks in six games in the Eastern Conference semifinals along the way.

Still, while the Knicks are 12-2 since the trade for OG Anunoby, the Heat are winless since making the deal for Terry Rozier. And the difference between the tenacity of Gabe Vincent and Kyle Lowry — both gone — in the playoffs and this incarnation of the Heat defending on the perimeter was vividly on display as Brunson seemed able to get anywhere he wanted with ease.

A 17-4 run allowed the Heat to tie the score at 86 before Randle hit a three-pointer with seven-tenths of a second left in the third quarter. That began a 16-3 run, and a subsequent 17-6 burst broke open the game.

Anunoby and Randle had 19 points each and Josh Hart added 14 points, nine rebounds and five assists for the Knicks, who shot 17-for-33 from three-point range. Jimmy Butler had 28 points for Miami.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME