It wasn’t pretty, but neither is this playoff race.
Desperate for a victory with the Hawks finally posting a win over the Sixers, the Knicks rallied from a 10-point first-half deficit to beat the pitiful Jazz 92-83 at EnergySolutions Arena.

The victory moved the Knicks to 3-2 on their concluded five-game West Coast trip, remaining one game behind the Hawks with seven games left.

“It can’t get much better than that,’’ coach Mike Woodson said of the 3-2 trip. “We get blown out in L.A. and Phoenix — those are tough places to win. We picked up three games on this trip. I’m pleased. Now we got to go home and deal with Brooklyn. [Wednesday at the Garden].’’

But now the Knicks face a rigorous April, in which all of those final seven will be against playoff teams. And they may have to do so without sparkling rookie Tim Hardaway Jr.

Hardaway sprained his right ankle while going up for an offensive rebound in the final seconds. X-rays were negative, but he moved very gingerly in the locker room and seemed to be hopping to the shower with the ankle heavily taped.

The impressive rookie hasn’t ruled out playing Wednesday, but he may be too optimistic. He needed to be helped off the floor to the locker room after being unable to put weight on it to get back on defense.

“They said something about a ligament being stretched out — just a normal sprain,’’ Hardaway said. “I’ll get treatment and see how everything goes. Hopefully I don’t [miss games]. I’ll try to put weight on it and see how it feels Wednesday. I don’t think it was the landing. Before I went to jump up, my body turned and my ankle twisted and caught a flat tire.’’

The Knicks were flat early, but Carmelo Anthony finished with 34 points (11 of 19, 8 of 8 on free throws) to carry the club. Utah’s awful shooting in the second half contributed to the victory as the Jazz recorded only 34 points. After allowing just 84 points to Golden State, the Knicks (32-43) held Utah to 83.

“We knew it was one we had to win and we gritted it out,’’ Tyson Chandler said.