Trey Burke of the Knicks goes to the hoop in...

Trey Burke of the Knicks goes to the hoop in the second half against Marcus Morris of the Celtics at Madison Square Garden on Saturday, Feb. 24, 2018.. Credit: Jim McIsaac

Kyrie Irving put on a show at Madison Square Garden on Saturday night. It was the kind of performance that has Knicks fans dreaming of Irving and Kristaps Porzingis teaming up in the near future.

Think 2019. That’s when Irving will be part of a star-studded free-agent class, and the Knicks hope to have the money and type of team that can attract a marquee player that summer.

The Celtics’ All-Star guard, who is from West Orange, New Jersey, had 31 points, nine rebounds and eight assists and received some of the loudest ovations of the night in Boston’s 121-112 victory over the Knicks.

“I love New York, but I’m from Jersey,” Irving said. “But playing at the Mecca is always fun. It has a way of bringing out the best in people.”

Irving proved to be too much for the Knicks and their three young point guards, although Trey Burke did his best Irving impersonation. He came off the bench to lead the Knicks (24-37) with 26 points for the second straight game and had eight assists.

Irving was too good. He shot 11-for-22 overall, including 6-for-12 on three-pointers, and scored 14 consecutive Celtics points in one third-quarter stretch. He hit four three-pointers in that span and put the Knicks in a 10-point hole they were unable to overcome.

Irving made the Knicks’ defense look foolish most of the night. When Frank Ntilikina took the challenge of staying in front of him, Irving went baseline and crossed him up with a dribble behind his back. Ntilikina fell, but Irving’s shot didn’t.

“He made the play,’’ Ntilikina said, “but he didn’t score.”

Tim Hardaway Jr. scored 17 points. Troy Williams, signed Wednesday to a 10-day contract, had 14, all in the fourth quarter. Emmanuel Mudiay had 13 points and six assists and Ntilikina added eight points and five rebounds. Jaylen Brown scored 24 points for Boston (42-19).

The Knicks’ plan the rest of the season is for the young players to get a chance to show whether they can help them. Burke has had two good games in a row, making some wonder why he didn’t get more playing time earlier. Jeff Hornacek even compared him to Irving.

“Trey’s been excellent,” Hornacek said. “It’s kind of that Kyrie factor. When you have a point guard that can shoot threes, can drive the ball, can kick it out to guys, it puts a lot of pressure on the defense. It opens things up for other guys.”

Burke scored 15 points in nine first-half minutes and helped the Knicks open an eight-point lead. After Irving’s third-quarter shooting display, Burke and Williams brought the Knicks within two twice in the fourth.

Irving then hit his fifth three-pointer of the half to make it 99-94. Williams followed that with a rousing lefthanded follow dunk, and Hornacek thought it would be a team-lifting momentum play. But Boston scored the next seven points, capped by an Irving-fed three-pointer by Al Horford that gave the Celtics a 106-96 lead with 5:24 to go.

“You got to stay locked in, you got to stay focused for the whole 48 minutes to beat a team like that,” Burke said. “I think we’re capable of doing it. Tonight we didn’t.”

With the playoffs all but out of the picture, the Knicks are looking to the future, with their sights on 2019. The free agents that summer could include Irving, Klay Thompson, Kawhi Leonard, Kemba Walker, Jimmy Butler and Kevin Love.

Irving already has given Knicks fans hope that he will call MSG home someday. He listed the Knicks among the teams he wanted to play for when he requested a trade from Cleveland over the summer. During All-Star Weekend, Irving revealed that he told Porzingis, “I would love to play with a big man like you.”

Porzingis, who is recovering from a torn ACL, could be a free-agent draw, but Irving also is in a great spot in Boston. Brad Stevens is one of the league’s best coaches, and the Celtics have a good young core that could be a contender for years.

The Knicks and their fans can dream, though.

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME