Chris Kaman had 18 points and a season-high 17 rebounds for Dallas, and reserve Troy Murphy chipped in 12 points.
Curry hit a 16-foot jumper off one leg to give Golden State a 90-88 lead with 1:57 left in regulation before Darren Collison connected on a 20-foot jumper with the shot clock running down to tie it at 90 with 36.9 seconds remaining.
The Mavericks had a chance to win it after that. But Vince Carter, who had left earlier in the fourth with a right hamstring injury, missed a long jumper over Barnes on the last play of regulation.
"It's very disappointing," said Mayo, who scored 23 points in the second half. "It's a game we should have had. But hats off to them, they played well tonight."
The Warriors outrebounded the Mavericks 62-43 and had a 19-7 edge in second chance points.
When Ezeli put back an offensive board over Kaman early in the third quarter, Dallas coach Rick Carlisle kicked the scoring table in frustration.
"Sometimes guys are bigger, stronger, quicker and faster," Carlisle said. "It's got to be part of who we are that we scramble and stay in there and battle."
Lee had 10 points and 12 rebounds in the first half, helping the Warriors take a 43-38 halftime lead. He had a pair of baskets in a 12-2 run in the second quarter that gave Golden State a 35-25 advantage, its largest of the first half.
It was nip-and-tuck in the second half. The Mavericks took their first lead with less than 5 minutes left in the third.
That was the first of 18 lead changes in the second half.
Notes: Carlisle said All-Star forward Dirk Nowitzki has "picked up his activity level" in his rehab from Oct. 19 surgery on his right knee. Carlisle didn't say when Nowitzki might be able to practice again. Nowitzki was expected to resume on-court activities six weeks after the surgery. ... Golden State F Richard Jefferson missed the game with a strained right calf.