Barham went 5-of-10 from 3-point range and Przemek Karnowski added 11 points with eight rebounds for the Bulldogs (12-2, 2-0 WCC), who learned before the game that Gary Bell Jr. would be out 4-to-6 weeks with a broken hand.
Sam Dower also missed Monday's contest with a back injury.
Kevin Pangos helped pick up the slack with 10 points, seven rebounds and four assists.
David Stockton and Gerard Coleman also netted 10 points each for Gonzaga.
Avry Holmes led the Dons (8-6, 1-1) with 16 points.