Williams hit a jumper and was fouled by Chris McNealy, then hit the ensuing free throw to put the Gauchos (5-8, 1-1 Big West) up by three. Taran Brown then blocked Alex Young's shot in the final seconds to seal the victory and snap UCSB's three-game losing streak.
UCSB got all but 11 of its points from three players—a career-high-tying 23 from Kyle Boswell, 22 from Williams and 18 from Brown. Williams added 10 rebounds.
Daman Starring led the Anteaters (7-8, 1-1) with 21 points, and Young scored 18. Adam Folker had 10 points, including a layup with 1:30 to play that tied the game at 71.
USCB improved to 4-1 at home. The Gauchos also won both their games against Irvine last season.