James scored 40 points, a career-high 16 assists and eight rebounds while Wade tacked on 39 to rescue the Eastern Conference leading Heat (41-14) and give them a league-high 12th consecutive victory.
"It was probably like 20 innings if it were a baseball game," James told reporters. "But we needed double overtime and we did it."
While on paper it figured to be an easy win for the Heat over the Conference's last-place team, the Kings made things tough for their high-flying opponents.
Miami led 110-101 with just over two minutes left in the fourth quarter before visiting Sacramento (19-39) ran them down with an 11-2 run that included three consecutive three-pointers from Marcus Thornton, who had a team-high 36 points.
After both teams scored 12 points in the first overtime, James tallied 11 points in the second as the home team outscored the Kings 17-5 to finally put the game away.
"We had every opportunity to win that game but it didn't fall our way this time," said Sacramento coach Keith Smart. "I thought our guys stayed right there."
Sacramento starters Tyreke Evans scored 26 and DeMarcus Cousins recorded 24 and 15 rebounds but they were outshone by Miami's high-scoring duo.
James became the first player to total 40 points and 16 assists since Phoenix's Kevin Johnson in April 1994.
(Writing by Jahmal Corner in Los Angeles; Editing by Peter Rutherford; )