Jesse Morgan had 12 and Williams finished with 10 for UMass (9-3), which has won six straight games. The Minutemen also secured their seventh straight road victory, the program's longest road streak since the 1997-98 season.
UMass led 37-29 at intermission but watched Miami (5-7) open the second half on a 9-2 run, cutting the deficit to 39-38. From there, the teams battled through eight lead changes and five ties until Williams' jumper gave UMass the lead for good, 70-69, with 1:12 left.
Allen Roberts led Miami with 21 points.
Reggie Witherspoon, who spent more than 13 seasons coaching at Buffalo, is returning to the city to coach Canisius College.
North Carolina Hall of Fame men's basketball coach Roy Williams is recovering from knee-replacement surgery.
Sparkling facilities are one thing, but Tim Miles needs to regain the momentum of Nebraska's 2014 run to the NCAAs if it is to play with the big boys.