Josh Hart of the New York Knicks reacts after his 10th...

Josh Hart of the New York Knicks reacts after his 10th assist completed a triple-double during the fourth quarter against the Orlando Magic at Madison Square Garden on Tuesday. Credit: Jim McIsaac

As he walked into the locker room before the game Tuesday night Karl-Anthony Towns offered hellos and fist bumps to the reporters and media relations staff in the near-empty room. He then made a point to reach out to one person he’d missed until he saw that it was an Orlando Magic reporter and he joked that he couldn’t offer him a greeting.

That may seem like a throwback to the old days of the Knicks, when the games were considered battles in a war, and whether it was Pat Riley or Jeff Van Gundy coaching, the opposition was the enemy. And the meeting with the Magic not only was a chance to play for a berth in the NBA Cup, but a chance to look in the mirror — or at least the mirror that they once saw themselves in and believe they can be again.

Towns kept the mood on the court, repeatedly exchanging bumps and shoves and a double technical with Orlando’s Mo Wagner. But if he was raising echoes of the old Knicks in spirit, he was exhibiting what the Knicks are now. Towns pulled out an assortment of Harlem Globetrotter-style plays as the Knicks ran over the top-ranked defense in the NBA for a 121-106 victory at Madison Square Garden.

With the win the Knicks clinched the East Group A title and a spot in the quarterfinals of the NBA Cup, finishing 4-0 in group play. By virtue of the point differential Milwaukee got the top seed and the Knicks took the second spot in the East and will host Atlanta in the knockout round. The winner will move on to the semifinals in Las Vegas. By the time the first quarter was over the only mystery was how much the Knicks would win by and what that would do to the Cup standings.

If the Knicks are taking their act to a Vegas residency this seemed a good audition as they dismantled the Magic defense.

“It just means the ball’s going in,” Jalen Brunson said. “We’re getting them rotating. We’re making the right plays. Especially our defense for sure, we get stops on defense and are able to run. It makes things a lot easier for us.”

There was the length of the court inbounds from Josh Hart to Towns, who leaped and knocked a touch pass to Mikal Bridges for a buzzer-beating jumper at the end of the first half. There was the through-the-legs, around the head no-look pass to Bridges. And there was the mid-move pause to shrug at a no-call from the officials before draining a turnaround jumper.

But it was the entire Knicks squad that ran through the vaunted Magic defense effortlessly, shooting 50.6% from the field and 42.9% from three-point range. Towns led the Knicks with 23 points and 15 rebounds. Hart posted a triple-double with 11 points, 13 rebounds and 10 assists. Brunson had 21 points without playing at all in the fourth quarter. The Knicks had six players finish in double-figures as they built leads of as many as 37 points.

Of the physical play with Wagner, Towns simply said, “”NBA Cup, bringing the best out of all us.”

As good as the Magic have been — winning six straight and 12 of 13 heading into this game and putting together the No. 1 ranked defense in the NBA — Orlando coach Jamahl Mosley warned before the game that the Knicks offense was a challenge.

“High powered,” Mosley said. “You got Jalen, who’s capable on any given night of giving you 40. KAT is able to do the same. Mikal coming into rhythm now. Josh on the glass, grabbing offensive rebounds. And guys, they’re shooting 39% from three as a team, 50% from the mid/around the basket, so we’ve got to do a great job defending. One, without fouling, and two, making them have to play in the half court versus getting out playing fast.”

The Magic could not do that. After building an early 14-6 lead it all fell apart. The Knicks led 36-27 after the first quarter and were up 71-51 at halftime. The lead kept expanding in the third quarter as the Knicks toyed with Orlando, which has been excelling this season without their star, Paolo Banchero.

The Knicks have managed to keep their starting lineup intact this season. Towns missed one game and that being the only absence for any of the five starters. And they have created a potent offense behind the play of Towns and Brunson. If this was a test of the top-ranked offense versus the top-ranked defense, it was clear offense wins the day.

“To me, the most important thing is net rating,” Knicks coach Tom Thibodeau said. The Knicks rank sixth in the league at that figure.

“How many do you score and how many do you give up? I think we’re Top 10 in points allowed. We’re top 10 in points allowed in the paint [and] top five in defensive transition. [We’re] top five in second chance points allowed [and] sixth or seventh in rebound margin.

“I look at it in totality. That’s the big thing. Would I like us to challenge shots better? Yeah. That’s a big thing.”