The Bucks led by 13 midway through the fourth period, but saw Cleveland come back to take a one-point lead on a 3-pointer by C.J. Miles with a minute to go. The Cavaliers, however, could not score another point.
Caron Butler put Milwaukee back in front by tipping in a missed shot with 24 seconds left and Mayo then wrapped up the game from the foul line.
It was the first home win of the season for the Bucks.
The Cleveland comeback was paced by Kyrie Irving, who 13 of his 29 points in the fourth period.
Pregnant Mila Kunis wins 'Best Villain' at MTV Movie Awards
'Happy' fan videos make Pharrell cry [VIDEO]