Curry finished with 23 points and 10 rebounds. Klay Thompson led Golden State with 27 points, and Jermaine O'Neal added 20.
Dallas had a three-point lead until Thompson made a 3-point shot with 1:01 remaining in regulation.
O'Neal blocked a Dallas shot with the game tied at 120, setting the stage for Curry's winning move. He dribbled the ball to the left side of the court and hit from 20 feet.
The Mavericks called timeout, but the inbounds pass failed to connect as time ran out.
Dirk Nowitzki led Dallas with 33 points and 11 rebounds.