The 7-3 building block for the Knicks’ future had one arm around teammate Willy Hernangomez and the other around a trainer as he walked stiffly off the floor 29 seconds into the fourth quarter Tuesday night at the Garden.

Kristaps Porzingis had moved down the lane to be in position for a lob, collided with Indiana’s Monta Ellis and didn’t get right back up.

“It was pretty painful at the moment,” Porzingis said.

He didn’t return, but the Knicks still ended up with an 87-81 victory, snapping their three-game skid and staving off clinching a fourth straight sub-.500 season.

Even when they win, they can lose. As it turned out, the injury wasn’t a major deal, just a left thigh contusion.

“It’s pretty stiff,” Porzingis said, sitting at his locker. “It’s stiffening up now. But it’s nothing serious.”

advertisement | advertise on newsday

The next game is against the Nets on Thursday night at the Garden. Porzingis wasn’t sure if he’ll be able to play or how long he’ll be out, just saying that it won’t be too long.

“I’m limping right now with all the stiffness that I have, but you never know,” Porzingis said. “I recover pretty quickly.”

Jeff Hornacek gave his concession speech before the game, saying that “the playoffs may not be in reach.”

“We can’t always think about playoffs, playoffs, playoffs,” Porzingis said. “The mindset has to be to go game by game and just try to get better every game.”

Porzingis shot just 5-for-17 on the way to 11 points. But he blocked three shots, giving him 17 in the last four games.

Knicks videos

“That’s something I can do well,” Porzingis said.

Hornacek said this closing stretch could be a time for “some of our other guys” to show what they can do with an eye toward next season.

The 6-11 Hernangomez, the rookie center who’s the other important young building block, swingman Justin Holiday, point guard Chasson Randle and guard Ron Baker had a chance to impress. Only Hernangomez stood out with 13 points and 16 rebounds.

“I know I’m very young,” Hernangomez said. “I have to keep working on a lot of things, my defense especially . . . Next season, I want to try to be a way better player and help the team from the beginning.”