Hayward, Utah's leading scorer, had failed to reach double-digits in the previous two games but was efficient from the start against the Bucks with 18 in the first half.
Favors took his turn as the center of the improving Jazz offense at crunch time with seven points in the final 2:02 to clinch the game.
The Jazz made all 17 free throw attempts and outrebounded the Bucks 43-34 in the matchup of teams with the worst records in each conference.
Larry Sanders went 7 of 7 on field goals to lead Milwaukee with 16 points, while Luke Ridnour had 12 points and Gary Neal finished with 11.
The Jazz were clinging to a 76-71 lead when Marvin Williams tipped a loose ball to Alec Burks that he turned into a layup. The Jazz stole it again on the next possession and Williams found Burks in the corner for a 3-pointer, widening the gap to 10 again.
Sanders scored on a spin move to cut the lead to 83-80, but Burks hit a running hook, Trey Burke hit a long jumper and Favors dunked with 2:02 remaining to give Utah some breathing room.
Playing without forward John Henson, who has a left ankle sprain, the Bucks were outmuscled in the paint and ran out of gas after their last run in the fourth quarter.
Diante Garrett, who joined the Jazz in mid-November, seemed to be auditioning to keep his job. The point guard played 20 minutes - the most in a competitive contest since his initial game with the Jazz - and scored 10 points, a career high. All contracts become guaranteed for the rest of the year on Jan. 10.
The Bucks' three-game Western Conference road trip got off to a promising start with a 94-79 win over the Lakers in Los Angeles on Tuesday. But the Bucks couldn't keep the Jazz off the boards or get critical stops down the stretch against the Jazz.
Burks had seven of his 13 points in the final period as the Jazz won their third straight home game and have won five of their last eight overall.
The Bucks missed their first nine 3-point attempts. Brandon Knight finally converted a 3-pointer in the third quarter. The Bucks finished 4 of 22 from beyond the arc.
Copyright 2016 Nexstar Broadcasting, Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.