James scored 32 points, including the last couple at the line to give his Eastern Conference-leading team the edge in the final seconds, while Wade missed a 25-footer at the buzzer.
“It came down to one possession,” James, who was knocked into the crowd when fouled on his final attempt, told reporters.
“I’ve got a headache. I just had to relax, I didn’t want to rush it. It was difficult, I was able to get up and knock them down.”
Wade matched his friend’s total of 32 points but scored just two in the second half, missed two free throws with 41 seconds to play and was responsible for a costly turnover six seconds from the end when Miami were leading 91-90.
Shaquille O’Neal stepped up with 19 points for the Cavaliers (35-11), who won their fifth straight and third without second leading scorer Mo Williams, who has a shoulder injury.
The Heat (23-21) took an early advantage and led by 11 in the third before Cleveland reined them in towards the end of the quarter.
Cleveland sharpshooter Daniel Gibson made two big three-pointers in the last quarter and had 15 in total while James scored all six of his fourth-quarter points at the free throw line.
Team mates on the 2008 Olympic squad as well as fellow draftees in 2003, James and Wade put on a one-on-one showcase in the first half.
Wade opened with 13 points in the first and added 17 in the second but reigning league MVP James topped him with 20 — a stretch including dunks and long jump shots.
“That was probably the most amazing thing I’ve seen in my life,” said Miami forward Michael Beasley.