The win kept San Francisco (14-12, 8-3 West Coast) tied with Gonzaga for second in the conference standings, 1 1/2 games behind St. Mary's.
Portland (18-9, 5-6) held a 66-63 lead with 4:56 left, but the Dons went on a 13-1 run. The key basket was a 3-pointer by Williams that gave USF a 73-67 lead.
Williams had seven points in the last 2 1/2 minutes.
Nemanja Mitrovic had 26 points, including four 3-pointers, and six rebounds for the Pilots.