The visitors were ahead inside the final four minutes but James made seven free throws, while setting up Kevin Love for a dunk, ensuring that the Cavaliers pulled away in the final moments.
The visiting side held a three-point lead at half time, but were stunned by the Heat's quick start to the third quarter, during which Miami outscored their opponents 30-16.
The teams were close throughout, with Metta World Peace adding a couple of baskets to put the Lakers ahead against his old team in the fourth quarter.
However, Carmelo Anthony ensured that the Knicks overhauled the Lakers' slender lead in the final two minutes, while Kobe Bryant and Louis Williams both missed three-point attempts in the last 30 seconds.
Kevin Durant and Russell Westbrook combined for 53 points, ensuring that the Thunder's lead was never fewer than nine in the fourth quarter, while a late run from Enes Kanter opened up the gap further.
Damian Lillard ensured that the home side were in a strong position heading into the final 12 minutes, but Detroit finished with a 41-11 spell.
Reggie Jackson added 26 of his career-high 40 points in the fourth quarter, helping the Pistons draw level with five minutes remaining, before he and Andre Drummond built a game-winning lead for the visiting side.
Results in full: Indiana Pacers 97-101 Cleveland Cavaliers, Los Angeles Lakers 95-99 New York Knicks, Toronto Raptors 76-96 Miami Heat, Phoenix Suns 103-124 Oklahoma City Thunder, Detroit Pistons 120-103 Portland Trail Blazers