Golden State kept the ball after the block, but the Warriors missed twice in a mad scramble to the final buzzer.
With Ellis' game off the mark, rookie point guard Shane Larkin gave Dallas a spark off the bench. The biggest boost was a running shot off one foot just before the third-quarter buzzer that put Dallas up by 11.
Dallas coach Rick Carlisle broke his rotation and put Larkin back in to try to stem a Golden State rally late in the fourth. He finished with seven points and six assists.
The Mavericks were in control at 99-82 with about 5 minutes left when the Warriors ran off 13 straight points to make it close.
Thompson started the run with a 3-pointer, and it really got going when DeJuan Blair was called for a foul in the backcourt and Ellis was given a technical for an outburst after the whistle.
Curry hit the free throw, Thompson hit another from long range and Curry dribbled between two defenders coming off a screen and hit the jumper to get the Warriors within 99-95.
Thompson had a chance to make it a one-point lead, but shot an air ball on a 3-point attempt from the right wing.
The Warriors were down six in the third when Larkin and Blair started a 12-1 run with one of several tag-team plays — a short bank shot from Blair on a feed from Larkin. Blair had 11 points and nine rebounds, including seven offensive boards.
Larkin and Draymond Green collided chasing a loose ball on Golden State's end, and Jae Crowder ended up with the ball and a three-point play after he was fouled on a layup by Nemanja Nedovic.
Dallas' Wayne Ellington matched his season high in the first half with six points, including a soaring one-handed dunk on a backdoor cut to give the Mavericks their biggest lead at 47-31 midway through the second quarter.
NOTES: A night after getting season highs in points, rebounds and minutes in his first start, Warriors F Jermaine O'Neal had six points and seven rebounds. ... Warriors C Andrew Bogut returned from a one-game suspension for his role in a scuffle with Portland and had eight points and 10 boards. ... A fan swished a half-court shot to win a 70-inch TV.