Carmelo Anthony didn’t waste any time putting on a show for newly minted Knicks president Phil Jackson.

With the Zen Master watching from the sidelines, Anthony scored 34 points on 12-of-23 shooting — with five assists and three steals thrown in for good measure — in a 92-86 win over the Pacers at the Garden.

“Hard times call for desperate measures,” Anthony said of the Knicks’ plight, as they trail the eighth-place Hawks by four games (five in the loss column) for the final playoff spot in the Eastern Conference. “Right now, our backs are against the wall.”

The Pacers, who saw a four-game winning streak snapped, presented a stiff upgrade in competition. The Eastern Conference leaders have 50 victories — a far cry from the 76ers and Celtics, two of the teams the Knicks beat earlier in the streak.

Despite facing a stingy Indiana defense that surrenders a league-low 92.3 points per game, Anthony carried the Knicks to a critical victory.

“It is huge for us. He is one player who doesn’t need any extra confidence,” J.R. Smith said. “It makes it better for him, the way we lost to them in the playoffs. The way he has been able to excel the last two months has been big.”

Anthony struggled early — shooting just 3-of-8 in the first quarter — but found his groove in the second half, scoring 11 points in the third quarter.

Early in the fourth quarter, with the Knicks — who had led by 16 at one point — holding a slim 68-66 lead and little momentum, Anthony made his biggest play of the night, finding Iman Shumpert for a 3-pointer, his only points of the night.

Anthony scored the next time down the floor to increase the lead to seven.

“It’s simple — if a man is open, you pass him the ball,” Anthony said. “My teammates made shots — when I found them, they [were] open.”

Anthony ended any hopes of a Pacers comeback with a driving dunk with just over three minutes to play, taking a feed from Smith to restore the lead to seven.

The Knicks still have a hole to dig out of if they are to make the playoffs for a fourth straight season, but Anthony said there is a palpable sense of energy that is stemming from Jackson’s hire.

“You can feel the energy when you walk into the building,” he said. “Out at shootaround early, you felt the energy. We want to keep that up and build on that.”