PHOENIX -- Yovani Gallardo has always pitched well against Arizona. Home, away, doesn't matter. He has the Diamondbacks' number.
"Sometimes you look at it as how this game is," Gallardo said of his track record against Arizona. "There are certain things like that I wish I could explain, but I just can't."
A day after losing to Arizona on a walkoff hit, the Brewers beat the Diamondbacks for the third time in four games behind Gallardo (5-4).
The right-hander entered the game with a 1.93 ERA against the Diamondbacks and lowered it by holding them to a run over seven innings. He improved to 7-0 in 10 career starts against Arizona and earned his 86th career win, tying Ben Sheets for fifth on Milwaukee's all-time list.
"We've had him on the ropes several times, but his somehow wriggles out of it, but today he just kind of dominated us," Diamondbacks manager Kirk Gibson said of Gallardo. "There wasn't a lot of opportunities out there for us and when we had the opportunities we didn't do anything with them."
Milwaukee's Carlos Gomez had a run-scoring single in the eighth inning to extend his career high-hitting streak to 15 games and reached base for the 32nd straight game, the majors' longest active streak.
Gallardo did most of the heavy lifting.
Coming off two solid starts, he retired the first 10 batters he faced until Chris Owings blooped a single to right in the fourth inning. Owings reached third, but Gallardo stranded him there.
The Diamondbacks had two hits to start the fifth inning and scored a run on Didi Gregorius' grounder, but that was it off Gallardo.
He allowed five hits and struck out four, improving to 5-0 in six career starts at Chase Field.
"He gets to where he's throwing a lot of strikes and you know he's going his rhythm going then," Brewers manager Ron Roenicke said.
Anderson (5-2) wasn't bad, either.
He had a superb start to his major league career, becoming the first Diamondbacks rookie to win his first five starts. Even though he pitched well, his run came to an end in his last start, when he allowed two runs on four hits in five innings of a 4-3 loss to the Los Angeles Dodgers.
The right-hander was good again against the Brewers, holding them without a hit until Aramis Ramirez led off the fifth inning with a double.
Ramirez made it 3-1 with a run-scoring single in the sixth after Jean Segura wound up on second with an infield single and a throwing error by Anderson.
Anderson allowed two earned runs on five hits and struck out five in six innings. He's allowed two earned runs or less in six of seven starts.
"That was one of the better days I've felt out there," Anderson said. "A couple of bloop hits, but limited the damage and felt good."
Gomez struck out three times before hitting a run-scoring single in the eighth off Matt Stites, who made his major league debut.
Gregorius, a shortstop throughout his career, made his first career start at third base to give Martin Prado a rest. He was tested right away and made a nice play, snaring leadoff hitter Scooter Gennett's sinking liner. ... Brewers OF Ryan Braun, who has played 999 career games, and C Jonathan Lucroy were given the day off. ... RHP Josh Collmenter will start Friday when the Diamondbacks open a three-game series against San Francisco. RHP Marco Estrada will pitch for the Brewers to start a three-game road series against Colorado on Friday.