The Knicks' Enes Kanter falls after losing the ball to...

The Knicks' Enes Kanter falls after losing the ball to the Spurs' LaMarcus Aldridge during a game Thursday, Dec. 28, 2017, in San Antonio. Credit: AP / Darren Abate

SAN ANTONIO — Kristaps Porzingis went to the bench with 2:30 left in the game, feeling frustrated that he had just fouled out and that the Knicks couldn’t turn a game in which they had battled into a win.

The Knicks’ road woes continued with a 119-107 loss to the Spurs on Thursday night. But instead of hanging their heads the way they had after many of their losses this season, they felt good about showing some fight a night after melting down in the final minutes in Chicago.

It still was their fourth straight loss — dropping them to 2-12 on the road and 17-18 overall — but even though the Spurs were in control throughout, the Knicks were happy with their effort.

“It’s never easy to accept a loss,” Porzingis said. “At least the good part is you fought hard. I think we fought hard. I gave my everything. I’m exhausted right now after that back-to-back. I didn’t have a great game, but I gave my all and still at the end, we had a chance to be close and win the game.”

It was another up-and-down night for Porzingis, who never got into any rhythm offensively. He was outmuscled inside by LaMarcus Aldridge and ultimately fouled out while trying to stop Aldridge inside.

Porzingis shot 6-for-16 and had 18 points and six blocks. Aldridge had 25 points, nine of them coming from the foul line.

“The last few fouls I got in the second half, maybe frustration,” Porzingis said. “He did a really good job sealing me when I was in front. I just had to be aggressive. I didn’t want to give up a layup. If I can give a foul, I’ll give a foul and make him earn it from the free-throw line.”

Michael Beasley led the Knicks with 23 points, 12 rebounds and four assists off the bench. Courtney Lee scored 18 points. Rookie Frank Ntilikina had nine points and a career-high 11 assists in his first game against one of his idols, fellow Frenchman Tony Parker.

Pau Gasol had 17 points and 11 rebounds for the Spurs. Kyle Anderson added 16 points and North Babylon’s Danny Green scored 15, all on three-pointers. Green shot 4-for-6 from outside the arc in the second half, each of them a dagger to the Knicks. “It was the timing of the threes,” Beasley said.

“They’re a really good team with the three-pointers, and the way they play, they were able to pick us apart a little bit,” Porzingis said.

The Knicks caught somewhat of a break when Kawhi Leonard sat with what the team called “return from injury management.” They’re not allowed to say “rest” anymore. Leonard has appeared in only five games this season because of a quadriceps injury, but the Spurs improved to 23-8 without him.

The Spurs (25-11) led by 11 points in the first quarter, 13 in the third and 17 in the fourth. The Knicks held only one lead — a one-point advantage early in the third quarter that lasted just 20 seconds.

Ahead 86-79 to start the fourth quarter, the Spurs scored on their first seven possessions of the quarter and extended their lead to 101-84 with 8:40 left. Aldridge had six points and Green buried a three-pointer in the run.

The Knicks got to within 109-100 with 3:30 left, but the Spurs’ Patty Mills hit a three-pointer on the next possession.

“We fought hard,” Beasley said. “This is not an easy building to win in. We showed grit. We showed perseverance. We’ve just got to put it together.”

“We’ll just keep battling, try and learn every game,” Jeff Hornacek said. “The effort was great. We didn’t come up with the win, but that’s what we want to see every night.

“It has to be that type of effort. Not against the Spurs, the Rockets, the Warriors; it’s got to be against every team we play. That’s what we’re trying to get to.”