The Heat were ahead by 10 points in the third quarter before the Spurs rallied behind Tim Duncan's 30 points and 11 rebounds.
"I don't know if we can play any better than that," said Heat coach Pat Riley. "We are going to have to, though. We are going to have to win despite all of the obstacles.
"We just didn't make the plays that we had to make defensively. They shot 68 percent in the fourth quarter. It just puts so much pressure on us offensively."
Manu Ginobili's lay-up with 36.5 seconds left put the Spurs in front.
Dwyane Wade, who had 27 points, then lost the ball while driving to the basket with the home crowd claiming a foul by San Antonio's Bruce Bowen.
"He was in that situation three or four times and got bumped three or four times," Riley said.
"I am not complaining -- he went strong, he was committed to go to the basket and to either score or draw (a foul)." Riley added: "I haven't taken a look at it (on video) and I am not going to get into it. Bruce (Bowen) is a great defender."
Ginobili added 18 points, 11 rebounds and eight assists for the Spurs.
Mark Blount had 23 points to follow Wade in scoring for the Heat.
Michael Redd had 37 points and Andrew Bogut contributed 17 points and 11 rebounds in the Milwaukee Bucks' 104-92 home win over the Indiana Pacers.
Monta Ellis scored a career-best 39 points as the Golden State Warriors beat the New Jersey Nets 121-119. The loss the seventh consecutive for New Jersey, despite 34 points from Richard Jefferson and 29 from Vince Carter.