The Bruins carry a 5-1 Pac-12 record into a three-game road series against the Cougars.
Ty Moore launched the game-winning three-run home run, his second of the year, in the 13th inning.
The Bruins are undefeated (4-0) in midweek games this year and have topped SDSU four-straight times.
Ty Moore and Trent Chatterton each hit their first home run of the season in the victory.
Grant Watson, Tucker Forbes, Grant Dyer & David Berg combined to allow just three hits and no runs.