HOUSTON — There are times when you can see Kristaps Porzingis still has a lot of work to do on his game. His offensive moves in the paint with his back to the basket will need an offseason to fully develop. And there are times where he still gets shoved around by smaller men.

But there’s plenty Porzingis can do right now to help the Knicks win games. The latest example came Saturday night when the 7-foot-3 rookie was dominant on both ends of the court as the Knicks beat the Rockets in Houston for the first time in 11 years.

Porzingis scored 24 points, grabbed 14 rebounds and blocked seven shots as the Knicks held off the struggling Rockets 107-102 to win their fourth straight and extend what has been a difficult start to Houston’s season.

Who would have thought a month into the season the 8-6 Knicks would leave the Toyota Center in a much better place than the 5-9 Rockets? After the Knicks concluded their franchise-low 17-win season last May, the Rockets added excitement to the postseason by reaching the Western Conference finals for the first time since 1997. The eventual NBA Champion Warriors defeated them in five games after the Rockets had overcome a 3-1 deficit to beat the Clippers in the Western Conference semis.

Kevin McHale, the former Celtics great, had taken the Rockets to the playoffs three straight seasons and seemed secure upon signing a three-year $12 million extension in December. But 11 games into this season, he was fired last week. Assistant coach J.B. Bickerstaff, a defensive specialist, was named interim coach and has gone 1-2 since.

To his credit, the Rockets stayed in the game until the final minute Saturday night, but couldn’t overcome Porzingis and a Knicks defense that toughened in the final quarter. Porzingis made 8-of-12 from the field, including 2-of-3 from 3-point range. Five of his rebounds came on the offensive end. But it was his blocked shots that saved the Knicks, including two late in the game on James Harden.

He turned back a Harden driving layup with the score tied 95-95 and then stuffed another with 1:06 left to secure the victory. In between, he gathered a key offensive rebound and was fouled trying to convert. Despite injuring his non-shooting hand, he made both free throws on a night where he was 6-for-6 from the charity stripe.

“He put together a real well-rounded basketball game,” coach Derek Fisher said of Porzingis. “The blocks were tremendous. It prevented them from scoring in a lot of different situations.”

The Knicks have now won the first two games of a four-game road trip that was supposed to test their resolve. A 93-90 win Oklahoma City was followed by the first win in Houston since 2004. After not having won seven games until Jan. 21 last season, 8-6 feels like 16-6 to the Knicks, who are finding different ways to win.

“I think we’re just scratching the surface right now of what we can be and where we’re trying to go,” said Anthony, who was plagued by foul trouble and finished with 14 points.

Porzingis, 20, was an unknown commodity to most when he was drafted. Now we have seen he can run the floor, score in bunches, isn’t afraid to mix it up and can block a half-dozen shots. A triple-double doesn’t seem far-fetched.

“When you’re 7-3, you just put your hands up and you’re blocking a shot,” Anthony said. “For him to have seven blocks, he was very active.”

Porzingis was happiest about the victory.

“We’re trying to build something,” he said. “We’re trying to be a great team. That’s what we’re working toward. I just have to be more consistent so I can help the team every game.”