LOS ANGELES -- It was a busted play that led to the winning shot for the New York Knicks, and Jose Calderon turned out to be the right guy in the right spot.

The 10-year veteran point guard hit a 3-pointer with two-tenths of a second left after Carmelo Anthony wasn't able to get open, and the Knicks pulled out a 90-87 victory over the Los Angeles Lakers on Sunday night.

"It was kind of a weird situation," Calderon said after his only 3 of the game. "The play was supposed to go to Melo, but he couldn't get free. I grabbed the ball and there weren't too many options out there, so I kind of got open for a minute and that was it. Sometimes when you're struggling a little bit, you make that important one."

More from FoxSports

Anthony scored 12 of his 26 points in the fourth quarter for New York. He shot 10 for 20 and had 12 rebounds.

"I wanted this one," Anthony said. "Going back and forth just made it that much better. I'm pretty sure we gave the fans what they paid to see out there tonight. The way this game played itself out, we didn't want it to come down to the wire, but it was one of those games that was for the ages."

It's been fun pic.twitter.com/mXEyUKrE93

— Los Angeles Lakers (@Lakers) March 14, 2016

Kobe Bryant had 14 points in his 29th and final head-to-head matchup in the regular season with Anthony. The Lakers had a combined 16-13 record in those games against the Knicks and Denver Nuggets.

"It was a very emotional situation, from the standpoint of competing against one of the greats, a friend and brother, for the last time," Anthony said. "This isn't just a basketball relationship. I mean, basketball brought us together, but this goes way beyond the court and we've taken it to another level."

The first time Anthony played against Bryant was Dec. 19, 2003, when Anthony had 24 points and Bryant 13 off the bench in the Lakers' 101-99 win over Denver. Their friendship blossomed when they were teammates on two gold medal-winning Olympic teams in in London and Beijing.

"We had so many battles throughout the years," Bryant said. "It's always strange, thinking it's the last time, but it's been fun."

The Knicks led by as many as 16 early in the third quarter before the Lakers cut it to 65-60 entering the fourth and pulled ahead 77-76 on a 3-pointer by Lou Williams with 4:50 to play.

🐍 at work pic.twitter.com/2vEXu8kIvi

— Los Angeles Lakers (@Lakers) March 14, 2016

Bryant reported back in with 3:32 remaining and the Lakers ahead by three. He hit a 9-foot turnaround jumper for an 81-76 lead, but Anthony drained a 3-pointer and a 21-footer to put the Knicks up 86-85 with 54.8 seconds to go.

Bryant's most productive game against New York was on Feb. 2, 2009, when he scored 61 points in a 126-117 victory - a Madison Square Garden record that stood until Anthony eclipsed it with 62 on Jan. 24, 2014, against Charlotte.

"He's an assassin, man. You can't take no plays off, going against him," Anthony said. "Even now, you're seeing flashes of him out there. He still has that look in his eyes when he gets the ball, and you have to play close attention to him. So we're definitely going to miss that."

The anticipated rematch between lottery picks Kristaps Porzingis and D'Angelo Russell never materialized. Porzingis, the Knicks' 7-foot-3 forward and fourth overall pick, was felled by a stomach virus and returned to the team's hotel.

Russell, the second overall pick in the draft, had just four points on 1-for-7 shooting.

Kobe keeps it going! #GoLakers 4th quarter on @TWCSportsNet | @TWCDeportes https://t.co/YvekRAJT6X

— Los Angeles Lakers (@Lakers) March 14, 2016

Robin Lopez had 16 points and eight boards for the Knicks. Sasha Vujacic, who played his first six-plus NBA seasons with the Lakers and won two rings, made his third straight start at shooting guard and shot 1 for 8 with five points.

New York is 5-9 since Derek Fisher was fired and replaced as head coach by Kurt Rambis.

Williams scored 12 of his 15 points in the fourth quarter for the Lakers after missing five games with a left hamstring strain.

Knicks president Phil Jackson, who coached the Lakers to five NBA titles, received a thunderous ovation from the sellout crowd when he was shown on the video board between the first and second quarters and the theme from "Welcome Back Kotter" was played on the public address system.

TIP-INS

Knicks: Rambis, who won eight NBA championships with Los Angeles as a player, assistant coach and executive, is 1-7 as a head coach against the Lakers. ... In the first meeting between the teams on Nov. 8 at New York, Porzingis had 12 points, 10 rebounds and no turnovers in the Knicks' 99-95 victory. Russell had six points and three assists. Both of them started and played more than 25 minutes.

Lakers: This was the third time that Byron Scott has coached against Rambis, his teammate during the Lakers' "Showtime" era when they won three NBA titles together. Rambis' Minnesota Timberwolves won the other two games against Scott's Cleveland Cavaliers during the 2010-11 season.

UP NEXT:

Knicks: At Golden State on Wednesday night.

Lakers: Host Sacramento on Tuesday night.