On a night Carmelo Anthony got ejected for a Flagrant 2 foul in a Thunder loss, Kristaps Porzingis notched 40 points.

On a night Anthony was tossed for what looked more like a regular offensive foul than anything that warranted an automatic flagrant ejection, Porzingis got superstar calls from the refs during his spectacular second-half rampage against the Pacers.

On a night the Thunder fell to 4-5, the Knicks moved to 5-4, winners of five of six.

Sunday’s thriller truly felt like a seminal evening at the Garden, a night the Anthony era could not have felt more distant.

A 7-foot-3 superstar has emerged before our eyes and a French rookie point guard named Frank Ntilikina looked beyond his years in his first crunch-time action, as the Knicks rallied from a 19-point hole late in the third.

One week ago, Enes Kanter stated Porzingis should be in the MVP conversation. Eye rolls ensued. No longer.

Porzingis has scored 30 or more points in seven of the first nine games — arguably the best individual start to a season in Knicks history. He’s now averaging 30.2 points — second in the league.

Before the season opener, Porzingis said he had three goals in mind for the season: an All-Star berth, and winning both the most improved player and defensive player of the year awards. None of the three appears out of reach.

All-Star is a gimme, and he should be considered a top candidate for MIP with his shooting percentage at a robust 50 percent (Anthony shot 43.3 percent last season and is at 43 percent this season, averaging 20.6 points per game for Oklahoma City).

Porzingis will stand as a long shot for DPOY, but coach Jeff Hornacek said his defensive prowess goes beyond his highlight-reel shot-blocking. Porzingis has cut down on his “silly fouls,” the coach said, and is in the right position, making the right rotation more often than not.

There’s been a buzz on social media that ousted president Phil Jackson should finally get his due for what’s happening.

Indeed, Ntilikina was a tiger on defense during the Knicks’ fourth-quarter rally, whipped passes to Porzingis and then drained two late 3-pointers.

Absolutely Jackson deserves kudos for the Ntilikina pick at No. 8 overall as the 6-foot-5 Frenchman looks like he’ll be a two-way playmaking stud who can drain the 3. Almost every other team president would’ve gone another way in that spot, with either Dennis Smith Jr., Malik Monk or Donovan Mitchell.

Absolutely Jackson deserves credit for knowing Anthony’s time was done here. But put the brakes on crediting Jackson for Porzingis. Jackson’s genuine interest in looking to deal the 22-year-old — and not repair the relationship — is why he was fired.

Jackson is on record stating Porzingis wasn’t ready to be the leading man this season. Privately, he questioned Porzingis’ strength as a low-post activator and his defensive acumen. Jackson would’ve pursued trading him even after the draft, fearing Porzingis’ brother, Janis, would have led him out of New York in 2019.

To boot, like Philadelphia, Jackson would have taken Duke center Jahlil Okafor at No. 3, figuring he’d be a beast as a low-post guy in the triangle. Okafor has been a bust with the 76ers and is hoping to be traded away as the team continues its rebirth led by Joel Embiid and Ben Simmons.

If Jackson passed on Porzingis at No. 4, the Magic and their assistant general manager, Scott Perry, would’ve gobbled him up. Perry is now the Knicks GM, working with team president Steve Mills.

Porzingis said Sunday night that Jackson’s remarks that he’s too young to be a No. 1 option motivated him.

“Of course,’’ he said. “The challenge is never too big for me. I always accept the challenge, and that’s why I knew coming into this season, Melo was not going to be here, then I’m going to have to be that guy, and that’s why I was just [working out] 24 hours in the gym.”

In Jackson’s final season, the Knicks boasted a celebrity-laden, marquee roster that included expensive additions, with Derrick Rose and Joakim Noah joining Anthony. Neither has played a second for the Knicks this season — Noah is suspended for PED use and will be back Monday. Rose is now on the Cavaliers, and on a minutes restriction. Nobody is missing any of the trio.

Ironically, the Knicks, who host Charlotte on Tuesday to end their five-game homestand, have a better record not only than Anthony’s Thunder, but Rose’s Cavaliers (4-6).

The Unicorn Era is off to a galloping start.

Hornacek has so many combinations at his disposal, but in turning back the Pacers, he went with the biggest lineup he could find for a portion of the fourth quarter. Hornacek had his twin giants in Porzingis/Enes Kanter, with Lance Thomas at small forward, 6-8 Doug McDermott at shooting guard and 6-5 Ntilikina at the point. It became quite a quintet and worth watching going forward. Hornacek went out of his way after the game to laud Thomas’ ferocious defense and point out his plus-23 game.

On Sunday, the club announced a crowd of 17,889 — lowest total since 2010. It was the third straight non-sellout. The Rockets drew 18,320 and the Suns 19,404. But that’s bound to change now.

This is especially noteworthy because of how sensational Garden attendance was through the miserable Melo era — selling out 277 of 278 games (19,812) entering the season.