Miami and Denver were tied 87-87 when James, who was content to pass for most of the period, scored two baskets to give the Heat a 91-90 lead before Ray Allen hit a floating jumper to seal the win.
Chris Bosh scored 17 points for Miami while guard Ty Lawson scored 26 points for the Nuggets, who have lost seven successive games - their longest losing streak in nine years.
Elsewhere, Sixth man Tyreke Evans nailed an 18-foot jumper with 1.9 seconds left after Jrue Holiday scored 15 of his game-high 31 points in the fourth quarter to lift the New Orleans Pelicans past the Portland Trail Blazers 110-108.
Evans' game-winner for the Pelicans came after Portland point guard Damian Lillard tied the game on a 28-foot three-pointer with 10.9 seconds left.
Shawn Marion scored a season-high 32 points including two clutch three-pointers in the fourth quarter as the Dallas Mavericks overcame the Minnesota Timberwolves 100-98.
Butler punishes Bulls
Minnesota, down by 21 early in the third quarter, rallied to take a three-point lead early in the fourth before Dallas made the final push that included consecutive three-pointers by Marion that put his team in front 95-90.
Minnesota forward Kevin Love scored 36 points and pulled down 11 rebounds while guard Kevin Martin scored 19 points.
Jimmy Butler scored a season-high 26 points to emerge the hero for the Chicago Bulls in their 95-91 victory over the Memphis Grizzlies.
Memphis cut an 18-point second half deficit down to a point, at 72-71, with 9:01 to play in the fourth but were never able to even the score with the Bulls.
Point guard Mike Conley led Memphis with 26 points, nine assists and a season-high six steals.
John Wall scored 29 points, his seventh consecutive game with at least 20 points, as the Washington Wizards defeated the Detroit Pistons 106-99 - their second victory over the same opposition in three days.
Washington erased a 12-point, second-half deficit to win for the fifth time in six games.
The Wizards opened the fourth quarter with 11 unanswered points to take an 89-87 lead that set up victory.
Forward Greg Monroe led the Pistons with 22 points.
Late lay-up for Jazz
The Utah Jazz overcame the Charlotte Bobcats 83-80 with Derrick Favors making a go-ahead dunk with 58 seconds remaining and point guard Trey Burke scoring the final two of his 21 points on a late lay-up.
Burke's basket with 19 seconds remaining put Utah ahead 80-77 and barely beat the shot clock.
Former Jazz centre Al Jefferson tried to tie the game with a three-pointer with 10 seconds remaining but missed.
Goran Dragic scored 26 points as the Phoenix Suns handed the Los Angeles Clippers their worst loss of the season, 107-88.
Phoenix snapped the Clippers' five-game home winning streak and pulled to within a half-game of Los Angeles for the Pacific division lead.
Blake Griffin and Jamal Crawford led Los Angeles with 15 points each but the Clippers were outscored 31-16 in the second quarter and never recovered.