Knicks guard Jarrett Jack (55) battles Dallas Mavericks guard Dennis...

Knicks guard Jarrett Jack (55) battles Dallas Mavericks guard Dennis Smith Jr. (1) for space during the first half of an NBA basketball game Sunday, Jan. 7, 2018, in Dallas. Credit: AP / Brandon Wade

DALLAS — Yeah, Kristaps Porzingis is tired. So are the rest of the Knicks. Tired of losing on the road. Tired of getting to the fourth quarter and watching the home team pull out a victory.

So on Sunday night, the Knicks did something about it. Finally.

After they let a 13-point fourth-quarter lead slip away, Jarrett Jack hit the tiebreaking basket with 31.2 seconds left to lead the Knicks to a 100-96 victory over the Mavericks at the American Airlines Center.

Porzingis, who said he was “tired” after a loss in Washington on Wednesday, scored 29 points as the Knicks improved to 19-21 (4-14 away from the Garden).

Kyle O’Quinn had 15 points and 11 rebounds and Enes Kanter added 13 points and 18 rebounds for the Knicks, who never trailed.

But it was Jack, who earlier in the day had his contract guaranteed for the rest of the season, who hit the biggest bucket of the night when the Knicks were staring another fourth-quarter road collapse in the face.

“We weathered the storm,” said Jack (12 points, eight assists). “We had some hiccups throughout it, but for the most part we weathered the storm. I was able to get a clean look thanks to KP setting an amazing screen.”

The Knicks, who had lost three straight and seven of eight, led by four points entering the fourth quarter and grew the lead to as much as 13. But Dallas went on a 15-2 run to tie it at 92 on Devin Harris’ three-pointer with 2:25 left.

After Jack’s runner in the lane gave the Knicks a 96-94 lead, J.J. Barea missed a three-pointer and Courtney Lee grabbed the rebound with 16.6 seconds to go. He hit two free throws and added two more with 7.3 seconds left for a 100-94 lead, sealing the win.

Lee, who was 4-for-4 from the line, is one short of Chris Duhon’s team record of 44 consecutive made free throws.

The rebuilding Mavericks (13-28) were led not by Dirk Nowitzki but by Harrison Barnes, who had 25 points. Nowitzki finished with five points and shot 1-for-7.

Porzingis shot 9-for-25 and was guarded late in the game by 6-5 Wesley Matthews, who got under the 7-3 Knick’s skin to the point that the two jawed at each other midway through the fourth quarter. “We were competing,” Porzingis said. “We were competing hard and it was physical. He said some words and I said something back. Nice conversation. I usually hear it. I usually keep going. This time it got a little too physical.”

Said Knicks coach Jeff Hornacek: “We got the lead there by 12 or 13 and they tried to muck the game up. They tried to get physical. They didn’t care about fouling. They wanted to see if they [referees] would let it go, and they did. We got a little stagnant there. We had some turnovers and couldn’t get the ball up the court quick enough, but then we made some good plays.”

Point guards were on display all night as Frank Ntilikina went up against fellow rookie Dennis Smith Jr. for the first time and former Knick Derek Harper had his number retired by the Mavericks during halftime.

Ntilikina was drafted eighth, one spot ahead of former North Carolina State star Smith. Ntilikina had seven points, seven rebounds and five assists. Smith had 11 points and five assists.

But Jack was the point guard who came out firing. He had eight of the Knicks’ first 19 points and the biggest two at the end.

“It’s always just good to win,” Porzingis said. “Things seem more positive always when you win. It was important. A lot of games that we were so close and we don’t have it at the end. We were able to finish a game and get a win for us.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME ONLINE