Knicks guard RJ Barrett dribbles the ball up court against...

Knicks guard RJ Barrett dribbles the ball up court against the Orlando Magic in the first half of an NBA basketball game at Madison Square Garden on Thursday, Feb. 6, 2020. Credit: Kathleen Malone-Van Dyke

The Knicks said goodbye to Marcus Morris on Thursday as he was dealt to the Clippers before the trade deadline.

Of more importance to the team’s longterm future, the Knicks said hello again to RJ Barrett, who returned to the court after a nine-game absence because of a sprained ankle.

Barrett, the third overall pick in the 2019 draft, had 12 points in his return and the Knicks staged a fourth-quarter rally to beat the Magic, 105-103, at the Garden for their third straight win.

Barrett said he felt “sore, but fighting through it. It was great to be back out there with my teammates. I just had a lot of fun out there. Our mantra for this week is have fun with it. That’s what I did. My teammates were great and we got a good win.”

The Knicks (16-36) trailed by as many as 10 points in the fourth quarter after leading by as many as 13 in the first half.

Wayne Ellington (12 points) got the Knicks back to within six with two three-pointers. Elfrid Payton’s three with 5:34 left tied the score at 96 and Julius Randle gave the Knicks the lead for good at 98-96 with a jumper at 4:59.

Randle had 22 points, Taj Gibson added 19 and Payton had 15 points, nine assists and seven steals. Nikola Vucevic led Orlando (22-30) with 25 points.

The day started with the news that the Knicks are planning to hire agent Leon Rose as their new team president, according to a source. Then came the afternoon trade of Morris, who had been the team’s leading scorer at 19.6 points per game.

“They have been such a good group in terms of the things that they have gone though as a team or the things that we’ve had individually and they’ve been there for each other and how they’ve stuck together,” interim coach Mike Miller said. “When it came time to play tonight, we just said, ‘Guys, you’ve won two in a row. You’re playing good basketball. You’ve got everything to play for. You’re playing in Madison Square Garden. Go play the game and have fun.’ ”

Miller started Frank Ntilikina instead of Barrett in the backcourt and shifted Reggie Bullock to Morris’ vacated forward slot. “We gave RJ a chance to kind of move into the game,” Miller said. “He hasn’t had a lot of practice days. So we felt like [starting] would put him in a tough spot.”

Eventually, Barrett will rejoin the starting lineup. The rookie entered the game for his first action since Jan. 16 with 5:28 left in the first quarter along with Mitchell Robinson to sustained applause.

The crowd was in a good mood because the Knicks were ahead by five and were in the process of building what would become a 12-point first-quarter lead.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME