Gallen (11-2) extended his scoreless streak to 41 1/3 innings. He allowed only two singles and a walk in seven innings. He struck out seven and retired the last 11 batters he faced.
Gallen tied Don Drysdale (1968), Orel Hershiser (1988) and Zack Greinke (2015), all with the Los Angeles Dodgers, by not allowing a run in his sixth straight start. Hershiser set the MLB record with 59 consecutive scoreless innings.
In those six games, Gallen is 5-0 with a 0.58 WHIP. He has allowed 16 hits, walked eight and struck out 46 in his scoreless streak. He is two outs away from matching the Diamondbacks' franchise record of 42 innings, set by Brandon Webb in 2007.
Daulton Varsho hit his 20th homer and helped preserve Gallen's scoreless streak with a running catch on Tyrone Taylor's drive to right center in the second. The catch came with two outs and a runner at first.
Gallen didn't allow more than one baserunner in any inning and struck out the side in the fifth.
The Diamondbacks scored in the second inning against Jason Alexander (2-2) when Corbin Carroll walked and advanced to third on Carson Kelly's single off shortstop Willy Adames' glove. Carroll scored on Alek Thomas' sacrifice fly. Varsho's home run, to right field, came in the third.
In the fifth, Jake McCarthy greeted reliever Hoby Milner with a broken-bat single to right, scoring Josh Rojas with Arizona's third run. McCarthy hit a two-run homer in the eighth off Brent Suter, his seventh home run of the season.
Alexander, a 29-year-old who debuted earlier this season, pitched 4 2/3 innings for Milwaukee. He gave up five hits, three runs, walked four and struck out three.
The Brewers, who managed just three hits in the game, began the day 2 1/2 games behind Philadelphia for the final National League wild card. They trail St. Louis by 8 1/2 in the Central Division race. Milwaukee is trying for its fifth consecutive postseason appearance.
Brewers manager Craig Counsell was denied his 600th career victory. The winningest manager in franchise history, Counsell is 599-542 (.524).