Ellis hit a jumper with 17.3 seconds left to put the Warriors up by four. He scored 24 points to lead Golden State, which won its second straight after a four-game losing streak. Curry had 16 points.
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.
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.