Dwyane Wade had 36 points and 10 rebounds to lead Miami but it was not enough to overcome Orlando's run in overtime.
The Heat overcame early troubles in the fourth quarter, missing 13 of their first 15 shots, to force the game into overtime. They went on a 12-0 run late in the fourth to tie the game.
Wade has a career 30-point average against the Magic. It is his highest average against any team.
Jermaine O'Neal had 14 points, six rebounds, and five blocks. Carlos Arroyo was the only other Heat player in double figures.
Carter had 27 points and Lewis had 24. Every started scored in double figures for the Magic.
The Heat are now in seventh place in the East and would face No. 2 Magic in the first round of the playoffs.