It's only the 16th win all season for the injury-plagued Lakers, but this is their third in a row, matching the season-best stretch from Dec. 9-14.
Ellington went 6-of-7 from the field in the last quarter to help the Lakers erase a 76-65 deficit.
"Wayne has a lot of confidence in what he's doing right now. He just came alive when we needed him to," Lakers coach Byron Scott said. "I'm not surprised. He kept his patience and didn't get discouraged. He kept playing."
Jordan Clarkson scored 16, while Jeremy Lin and Jordan Hill each had 14 points.
Ersan Ilyasova had 17 points and 12 rebounds for the Bucks, who have lost three of their last four games.
John Henson's one free throw gave Milwaukee its 11-point advantage, but the Lakers scored the next 10 points, capped by Ellington's shot from beyond the arc. His layup gave the hosts the lead for good at 85-83 with 5:09 to go.
A layup from Jerryd Bayless cut the margin to 94-91 with 1:25 left, but Hill's jumper made it a two-possession game. Bayless then lost the ball on a drive toward the hoop. That led to a breakaway jam from Wesley Johnson with a minute left that sealed the outcome.
LA scored the opening seven points, on the way to a 24-18 lead at the conclusion of the first quarter. A 19-2 burst in the second gave the visitors a 43-36 lead. The Bucks were up, 47-45, at the half.
Milwaukee was up as many as 11 in the third and entered the fourth with a 72-65 edge.