\Knicks guard Jalen Brunson controls the ball against Spurs guard Romeo...

\Knicks guard Jalen Brunson controls the ball against Spurs guard Romeo Langford in the first half of an NBA game at Madison Square Garden on Wednesday. Credit: Kathleen Malone-Van Dyke

Julius Randle was finishing up his postgame interview and he got up from the table, leaving Jalen Brunson to handle the rest of the questions — offering him a bottle of wine as he departed.

It might have seemed a good night for Randle to offer up an assist after Brunson delivered a career-high 38 points to lead the Knicks to a hard-fought 117-114 win over the San Antonio Spurs at Madison Square Garden.

Randle endured a rough shooting game — just 9 of 26 from the floor — and it was Brunson who salvaged the night not just with the point total, but delivering clutch shots one after another down the stretch.

“Whatever it takes to win,” Brunson said. “I could have 38 or I could have three points. If we win that’s all I really care about. That’s my goal, my mindset and it’s the mindset of this team that we’ve got to keep it going. It does feel good with a win. Just whatever it takes. “

It was less than a week ago that the Knicks were left to explain a disappointing loss in San Antonio to a young Spurs team with one of the worst records in the NBA. San Antonio coach Gregg Popovich had a clear vision of what was missing that night.

Brunson sat out that game with the sore right hip and while the Knicks got plenty of production in his place, there was something missing — the leadership and ability to get them what was needed at the most crucial times. And in the rematch, the Knicks needed everything he had.

“I want them to recognize Brunson will be on the floor tonight,” Popovich said before the game. “He wasn’t there last time. He’s a monster. He’s got a such a toughness about him. High basketball IQ, hard to guard. He really, really tests your discipline, gets you jumping off your feet. For a little guy, he has great pivot that he uses oftentimes in the paint, that sort of thing. But he’s also unselfish. So concentrating on him is pretty important.”

Brunson had his way against the young Spurs defenders — manipulating them with an assortment of shot fakes and footwork. He scored early — 13 first-quarter points — and then with the game slipping away, he scored late. Down 111-110 Brunson drove past Keldon Johnson down the right side of the lane with 3:03 left to put the Knicks in front. And then after saving the ball after a jump ball, he delivered a 20-foot elbow jumper. One more time he lined up in the same spot and drained another jumper to push the Knicks in front by four.

The Spurs were hard to shake, though. After Brunson gave the Knicks the 116-112 lead they turned the ball over, Randle missed on a jumper and a pair of free throws by Johnson with 29.7 seconds left made it a two-point game. The Knicks lost the ball again and San Antonio was set to inbound with 5.7 seconds left. But rookie Jeremy Sochan was whistled for a five-second violation, giving the ball back to the Knicks. After a timeout, Immanuel Quickley inbounded to Evan Fournier and he was fouled with 4.1 seconds left. Fournier drained the first free throw but left the door open as he misfired on the second.

San Antonio took its final timeout with 3.5 seconds left and this time they got the ball in, but with Quentin Grimes guarding Keldon Johnson, he tried to pump fake on a long three and the clock ran out without even getting a shot off.

“Yeah, we had to turn up a notch,” Brunson said. “We had to grind It out, just find a way to win. I think most importantly we kind of just talked to ourselves and got ourselves in the mindset we need to finish the game no matter what, no matter how we’ve just got to do it. We fought. Things weren’t perfect . . . But we’ve just got to find a way to win.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME