LeBron James bursts the Knicks’ bubble as the Lakers star dazzles with 24 points in a 113-105 win for LA at Madison Square Garden

As the Lakers flew to New York for a primetime matchup with the Knicks, you would have been hard-pressed to find two teams that had more opposite trajectories recently.

Things had gotten so bleak for the Lakers lately that LeBron James’ agent, Rich Paul, felt it necessary to indicate this week that his client would not be traded.

Meanwhile, the Knicks just had their best month in 30 years, and point guard Jalen Brunson is getting real MVP buzz.

On Saturday, these divergent paths crossed, if only for a few hours, and it was the Knicks who came out on top with a gritty 113-105 win over their short-lived hosts.

Unsurprisingly, the Knicks fans were in good form. James was the only Laker cheered during the pregame introductions — and it was a huge ovation at that — while the crowd later booed early in the second quarter as he stood at the foul line after a questionable call.

LeBron James threw down a dunk in the first quarter, while D’Angelo Russell bounced the ball off the ground to him

Jalen Brunson drives to the basket against the Lakers on Saturday evening at MSG

Jalen Brunson drives to the basket against the Lakers on Saturday evening at MSG

James said before the game that he had considered joining the Knicks in free agency in 2010, and he wasted little time in putting on a show for his potential fans.

About three minutes later, he intercepted a pass and threw it forward to a wide-open D’Angelo Russell on the other end. But to the crowd’s delight, Russell refused to shoot himself and instead bounced the ball off the ground for James to dunk home.

The Knicks found these types of short yards easier to convert early on, shooting just 25 percent from three-point land in the first quarter. Notably, the home team was down two starters in OG Anunoby and Julius Randle, and it was evident as they relied heavily on Brunson and Donte DiVincenzo to score.

The Lakers led 27-25 after one, and after trading mostly in the second quarter, the Lakers went up by five with 3:01 left in the half on a Taurean Prince three.

It wasn’t a huge lead by any means, but a mini-run by the Lakers could have given the game a different feel heading into halftime after what had been a close game up to that point.

Instead, the Knicks dug in their heels and tied the game at 59-59 to end the period.

Brunson's recent play has rightfully put him in the MVP discussion for this season

Brunson’s recent play has rightfully put him in the MVP discussion for this season

Anthony Davis reacts after a dunk against Knicks center Isaiah Hartenstein (55

Anthony Davis reacts after a dunk against Knicks center Isaiah Hartenstein (55

The game reached a fever pitch in the third quarter. A wide-open Isaiah Hartenstein dunk turned up the volume about halfway through the quarter — putting the lead at six — but The Garden reached deafening levels soon after after a frantic sequence.

It featured a DiVincenzo block on James, two emphatic rejections from Davis on Brunson and Hart at the other end, and ended with Austin Reaves sprinting to the other end but was fouled by DiVincenzo and remained on the field next to nearby James lie. .

The pairing was fine, and Reaves made both of his free throws, but it was a momentum swinger for the crowd, which erupted into chants of “Let’s go Knicks” as the officials reviewed the call.

They soon had reason to cheer even louder, as a Brunson three with 1:12 pushed the lead to eight.

The Lakers would fight back early in the fourth, however, when buckets by Prince and James cut the lead to 1 and caused Knicks coach Tom Thibodeau to call a quick timeout.

Soon the Lakers’ tally increased by three, and while Hart immediately responded with a three, the visitors’ current advantage in scoring depth quickly reared its ugly head.

D'Angelo Russell #1 of the Los Angeles Lakers celebrates a three-point basket during the game

D’Angelo Russell #1 of the Los Angeles Lakers celebrates a three-point basket during the game

Reaves and Prince both scored big, especially the former, who scored 14 of his 22 points in the quarter. And while there were some sloppy turnovers from the Lakers (including an up-and-down one) from Prince, the Knicks just didn’t have enough outside of Brunson and DiVincenzo.

With about four minutes left, Brunson dribbled in a circle, surveyed his options and finally hoisted up a hard-fought jumper as James struggled in close quarters. The shot fell short, and it was a handy microcosm of the lack of help the Knicks’ star got tonight.

James, meanwhile, had enough as Davis was imperious with his late post defense.

The four-time MVP then took matters into his own hands, pushing the lead to nine with a mid-range jumper just after the clock ticked under two minutes.

There was no coming back from that for the Knicks, and their fans quickly headed for the exits.