MEMPHIS, Tenn. — It took 59 games, but the Knicks finally got Mitchell Robinson in uniform and on the court, providing an opportunity to see the team as it was envisioned when the season began.

In this first rust-shaking appearance, the heroics belonged to Jalen Brunson, who carried the Knicks to the finish line, and OG Anunoby, who delivered the winning three-pointer with 4.3 seconds left for a 114-113 victory over the Grizzlies at FedEx Forum.

Brunson has delivered so many times in these situations for the Knicks — a fact that Memphis was well aware of. But this time, as he weaved through a maze of defenders scrambling around him, he found Anunoby on the left wing for an open three-pointer that put the Knicks ahead by one.

“Utmost trust and confidence in my teammates regardless,” said Brunson, who had four Grizzlies around him when he made a perfect pass to Anunoby. “Everyone converged in and then I saw OG open and instinct hit and I knew he was going to hit it.”

Brunson dribbled to his right and got past Ja Morant, leaving Vince Williams Jr. behind Morant and in no position to make a play, and when Jaren Jackson Jr. left Josh Hart and moved toward the driving Brunson, he fired a pass to his left past Santi Aldama to Anunoby. Aldama closed out hard on Anunoby and made a desperate leap, but he was too late to affect his shot.

Said Anunoby: “Knowing that situation, the attention JB gets on that, I might be open, so just be ready.”

The Knicks (39-20) still had to make one more stop. Morant made a nice dribble move to get past Mikal Bridges but missed a driving lefty layup, and when Aldama reached over Robinson but missed the potential tip-in, Robinson grabbed the rebound to clinch the victory.

“They trust me,’’ Robinson said. “You know, been 10 months and put me in a big possession to get a stop, it shows that he trusts me. He still rocks with me.”

With the Knicks trailing by two, Bridges’ defense forced an eight-second violation with 33.3 seconds remaining. Brunson sank a three-pointer with 7-4 Zach Edey reaching out, and the Knicks were up 111-110 with 23.9 seconds remaining.

At that point, Robinson, who had six points and five rebounds in 12:20, went back in the game. Morant then drove past Bridges and converted a three-point play to give Memphis a 113-111 lead with 14.4 seconds left.

Brunson had 23 points, seven rebounds and six assists, Anunoby finished with 19 points and Deuce McBride had 17 off the bench for the Knicks, who were 6-for-11 from outside the arc in the fourth quarter.

Morant scored 25 points and Desmond Bane had 24 for the Grizzlies (38-21). The Knicks held Memphis to 0-for-10 shooting from three-point range in the second half.

It had been nearly 10 months since Robinson was last in uniform for the Knicks and nearly 15 months since he underwent the first of two surgical procedures on his left ankle, both of which necessitated lengthy rehabilitations.

The return came just in time, it seems, as the Knicks head down the final six weeks of the regular season with an assortment of bumps and bruises, in need of help on the court in terms of depth and defense.

Just ahead of game time Friday, the Knicks announced that Robinson would make his season debut and that Karl-Anthony Towns and Hart, both of whom were questionable, were in, too.

That gave the Knicks the most complete team they’ve had all season, missing only Ariel Hukporti, who underwent surgery to repair a meniscus tear suffered Wednesday.

Despite all of the warnings about short stints to acclimate him to game action again, Tom Thibodeau had to go to Robinson early in the game as Towns was whistled for his second foul 4:43 into the game. In a span of 5 minutes and 36 seconds, Robinson recorded an offensive rebound, scored four points with an eye-opening fake dribble handoff and driving dunk and then a low-post move, deterred a handful of shots at the rim and looked understandably gassed when it was over.

“You know, first game back, so it’s hard to say,” Thibodeau said. “Obviously, games are a lot different than practices. But just he’s a vet, so I think he understands exactly who he is. Play to your strengths, go as hard as you can. Short stints. His timing will come around, but the defense, anticipating that being there right from the start.”

Robinson’s teammates, who have seen him on the practice court working out and pushing for this return, were happy not only to have him back on the court but to have him in the locker room as pressure mounts down the stretch.

“The basketball part, I [couldn’t] care less right now,” Brunson said after the Knicks’ morning shootaround. “Just seeing how hard he’s worked to get back to where he is now, I’m really excited for him. Like I said, I [couldn’t] care less about the basketball. I just like seeing the person happy and excelling.”