Ellis hit a jumper with 17.3 seconds left to put the Warriors up by four points. He scored 24 points to lead Golden State, which won its second straight after a four-game losing streak. Curry had 16 points.
Dorrell Wright also scored 16 points, while David Lee added 15 and Reggie Williams 13 as the Warriors ended a four-game slide against Milwaukee.
Corey Maggette scored 12 of his 21 points in the fourth quarter for the Bucks, who lost their third straight. Luc Mbah a Moute had a career-high 19 rebounds and a season-high 15 points. Ersan Ilyasova had 23 points, two off his career high, and 13 rebounds.
Maggette hit a driving layup to pull the Bucks to 96-94 with 10.3 seconds left but missed the ensuing free throw. Lee grabbed the rebound and Golden State's guards made their free throws down the stretch to help the Warriors retain their advantage.
Carlos Delfino scored 20 points despite making just nine of 22 shots, including a 2-of-10 performance from 3-point range.
Ilyasova hit a milestone, needing 12 rebounds to reach 1,000.
Milwaukee took a 73-72 lead into the final quarter.
The lead changed hands 12 times in the second quarter, including 11 of the final 13 made baskets, with the Bucks taking a 47-46 edge into the intermission.
There were no lead changes in the third quarter — though there were two ties — and neither team led by any more than seven points in the game.
Notes: Warriors G Acie Law was inactive due to a sprained right wrist. ... Bucks C Andrew Bogut missed his second straight game with a sore right knee. ... Ilyasova scored 15 of the Bucks' 22 points in the first quarter on 6-of-7 shooting. ... The Warriors honored Al Attles as part of Hardwood Classic Night. Attles, in his 51st year with the team, coached the Warriors to their only NBA championship in 1975. ... Mbah a Moute is 23 of 43 from the field (53.4 percent) over his last 10 games. ... The game was tied nine times and there were 22 total lead changes.