Evan Longoria had three hits, including a three-run homer, and drove in four runs, Kevin Gausman struck out nine in five scoreless innings and San Francisco broke a three-game losing streak with an 8-0 victory over Arizona on Tuesday night. Longoria hit his sixth homer of the season in the third inning for a 6-0 lead off Corbin Martin (0-2) and doubled in a run in the seventh. Gausman (5-0) gave up five hits and two walks and allowed only one runner past second base while lowering his ERA to 1.53.