Klay Thompson tied a season high with 27 points to lead the Warriors, who have won five straight.
LeBron James led Miami with 31 points as he reached the 20-point mark for the 25th consecutive game, the longest current streak in the NBA.
David Lee scored 22 points and grabbed 13 rebounds, and Jarret Jack added 20 points off the bench for the Warriors.
Wednesday’s victory over the former NBA champs adds to their best start since 1991-92, as they improved to 15-7 and 9-4 on the road.
Golden State took a 77-74 lead into the fourth quarter after leading for most of the third.
After hitting a 3 to tie the game at 87, Lebron James gave the Heat their first lead since early in the third with a turnaround 18-footer with 6:39 left for an 89-87 advantage.
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.
With this win the Warriors proved to the NBA world that they can compete with anyone on any given night.