Dirk Nowitzki scored 41 points and Marquis Daniels added 22 as the Dallas Mavericks beat Miami 113-93 on Thursday.
The Mavericks' victory handed the Heat their first loss of the season and ended their franchise-record 14-game home winning streak.
Elsewhere, Kevin Garnett hit a jump shot with 8.3 seconds left as the Minnesota Timberwolves won 96-91 against the Houston Rockets.
In Denver, the Nuggets recorded a 117-109 victory over the Pistons.
"We had a great night," Nowitzki said. "Everybody was shooting well, and it didn't matter from where they shot it. We did a lot of things right.
"We shot the ball well, we drove to the basket and got to the foul line."
Shaquille O'Neal had 22 points - giving him 22,002 for his career - and 10 rebounds for the Heat, who lost for the first time in five games this season.
"We had a lot of defensive lapses and they shot the ball well," O'Neal said.
"We got into a hole, and I felt we had a couple opportunities to get out of the hole but they shot the ball well. Dirk had a hell of a game. He's a great player."