Mavericks guard Jalen Brunson passes the ball past Knicks guard...

Mavericks guard Jalen Brunson passes the ball past Knicks guard Immanuel Quickley during the second half of an NBA game Friday at Madison Square Garden. Credit: AP/Vincent Carchietta

When Kristaps Porzingis came out of the locker room Friday night, minutes after the rest of his Dallas teammates had started the layup line before the game, the sparse crowd at Madison Square Garden had the former Knick targeted.

Loud boos rained down and chants were directed at him. It didn’t let up as he was stripped the first time he got the ball and then bricked a three-point field goal. He finished the first quarter 1-for-7 and was firmly in the sights of the fans, who created almost a serenade that rose and fell each time the ball came to him.

But Porzingis got the last word, dunking off a lob in the final minute to send the fans home silenced. The shot was a final dagger in a 99-86 win for his Mavericks over the Knicks.

Porzingis struggled through a 6-for-17 shooting night, including 1-for-7 from beyond the arc, and missed eight of his first nine shots before finishing with 14 points and eight rebounds. But the Knicks had their own struggles. Julius Randle shot 5-for-20, RJ Barrett 3-for-11 and Derrick Rose 1-for-10.

Luka Doncic dominated play late and finished with 26 points, eight rebounds and seven assists for the Mavericks. Alec Burks had 20 points and Randle added 14 points, 11 assists and eight rebounds for the Knicks.

"The reaction was what I expected, of course," said Porzingis, who was traded on Jan. 31, 2019. "I’m happy we got the win. We lost the last two last season. And tonight, we grinded this game and got the ‘W’ on the road against them. They are a tough team and they played really good defense on me and on us in general. Just overall a tough game, a grinding game, and it’s good to come up with a win against a tough team like the Knicks."

Rose, who played with Porzingis in New York, felt for him as he heard the boos.

"To be honest, yeah," Rose said. "But when you think about the situation, it wasn’t an easy situation for both sides, with him wanting to leave and with them, the fans felt like they put their all into him by supporting him. I get it. I been in a similar situation when I left Chicago. People felt like it was me. I’m not going to talk too much about it, but yeah, I get both sides."

It was the third straight loss for the Knicks, who fell to 24-25 in the tightly bunched Eastern Conference standings. Dallas won its third straight on the road, improving to 26-21 after a 9-14 start. That’s bad news for the Knicks, who hold the Mavs’ first-round pick in the upcoming draft as part of the Porzingis trade.

The debate about whether the Knicks should have traded Porzingis or if they got enough back for him will rage on at least until the second of two No. 1 picks they received in the deal is used in 2023.

"I think you just deal with where you are today," Knicks coach Tom Thibodeau said before the game. "I wasn’t here so I can’t really comment on all that went into the decision-making there. He’s a good player, a terrific talent. They’re an excellent team. And we feel good about the people that we have."

The Knicks built a 13-point lead midway through the second quarter, in no small part because of the play of Obi Toppin (nine points), who came off the bench for an energetic seven minutes and shot 4-for-5, including a tip dunk over a crowd of Dallas players, including Porzingis. But an 18-2 run by the Mavs before halftime gave them a 49-46 lead.

Dallas led 78-75 with 6:57 to play in the quarter before going on a 12-0 run sparked by Jalen Brunson (15 points).

Newsday LogoCovering LI news as it happensDigital AccessOnly 25¢for 5 months