The Heat, down by 11 at half-time and by seven with just under two minutes remaining, stormed home thanks mainly to Ray Allen who scored the last seven points to push the Heat to 10-3 on the season and 6-0 in Miami.
Allen coaxed in a lay-up and drew a foul with 1:32minutes remaining for a three-point play and then gave the Heat the lead with 18 seconds left with a three-pointer.
Cavaliers guard Jeremy Pargo had a chance to send the game to overtime but Dwyane Wade blocked his late shot.
LeBron James top scored for the Heat against his former team with 30 points while Chris Bosh added 23 and Wade 18.
The Cavaliers had eight players in double figures, led by Pargo and Dion Waiters with 16 each, but the impressive team performance still was not enough, dropping them to 3-10.
"First of all, Cleveland played a very good basketball game," Heat coach Erik Spoelstra said.
"They did enough to put themselves in position to win but our guys absolutely relish those moments in the fourth quarter, the competitiveness of a close game.
"We need to get out of here quick as we can before they put more seconds on the clock."