The teams played a one-possession game over the next four minutes before Lee knocked down a pair of free throws to tie the game at 95 with 1:54 left.
The score was still tied at 95 with under a minute remaining. Allen had a chance to give the Heat a lead with 46 seconds left. Lee followed by missing a driving layup. Battier's miss from the corner with 12 seconds left gave the Warriors an opportunity in the closing seconds.
"Ray got two clean looks, Shane got a clean look, Chris had some daylight on his roll to the rim, for the most part our execution going down the stretch we've had a lot of those games where that ball is going in and it changes your perspective," Spoelstra said.
The Heat received a scare in the second quarter when Lee sent James to the floor with a flagrant foul sending James to the floor on his back.
James popped up quickly, but spent the next couple of minutes stretching out his right shoulder before knocking down the free throw and hitting a shot on the ensuing possession for a 47-43 lead.
"I'll be all right," said James, who had an ice pack on his shoulder after the game. "It will be sore tomorrow, but I'll be ready by Saturday. That's all that matters."
Moments later, Dwyane Wade was poked in the eye by Thompson while trying to fight through a screen. With Wade's head down, Chris Bosh ran into Wade knocking him to a floor. After staying down on the floor, Wade eventually got to his feet and went to the locker room holding the back of his neck with 3:11 left in the half.
"Right now it's fine," Wade said. "Hopefully it doesn't stiffen up on me tonight."
Thompson helped the Warriors take a 53-52 lead into halftime by scoring 21 points including five 3-pointers. Thompson scored 14 points in the second quarter, including 11 in a four-minute span.
Wade returned for the second half and opened the scoring with a dunk.
Both teams got off to a good start offensively, but it was defensive efforts by both teams which sparked the first highlight of the game.
After Stephen Curry picked off a pass by James, Wade returned the favor deflecting Curry's pass and ran toward the sideline saving the ball with an around-the-back pass to Mario Chalmers. Chalmers then found James, who tipped a pass to Wade for a layup and a 23-22 lead.
"We played against two guys (James and Wade) that will go down as all-time greats," Warriors coach Mark Jackson said. "For us to grind out a victory against the champs, it's special."
NOTES: Thompson has made at least five 3-pointers in three of his past five games. ... Prior to the game, Warriors head coach Mark Jackson said he believes Wade is the third-best shooting guard in NBA history behind Michael Jordan and Kobe Bryant. "I see a guy I love as a basketball fan," Jackson said of Wade. ... Curry had his career-best streak of eight consecutive games with at least 20 points snapped as he scored nine points.