PHOENIX - Wily Peralta pitched seven effective innings, Aramis Ramirez lined a two-run double in the eighth inning and the Milwaukee Brewers broke open a close game late for a 9-3 victory over the Arizona Diamondbacks on Monday night.

Peralta (7-5) shook off a shaky second inning to keep the NL Central-leading Brewers close against Arizona and Brandon McCarthy.

Milwaukee ran away with it once McCarthy left, scoring three runs in the eighth against Will Harris (0-2): two on Ramirez's third hit and another on a run-scoring single by Khris Davis.

Ryan Braun hit a two-run triple off J.J. Putz in the ninth inning and Scooter Gennett had a run-scoring single after homering earlier in the game for the Brewers, who had 12 hits.

McCarthy was solid through seven innings and had a two-run single in the second.

Both starters were shaky before settling down.

Peralta appeared to be back on track in his last start after two shaky outings, holding the New York Mets to a run over 6 2-3 innings.

The hard-throwing right-hander didn't keep the momentum rolling early against the Diamondbacks, giving up five hits in Arizona's three-run second inning.

Roger Kieschnick had a run-scoring single in in his first at-bat after being called up to replace Bronson Arroyo, who was placed on the disabled list for the first time in his career due to a sore elbow.

McCarthy, a .125 hitter this season, followed with a jam-shot single to right, driving in two more runs to put Arizona up 3-2.

Peralta was sharp after that, retiring 10 straight batters until Kieschnick lined a leadoff single in the seventh. Arizona got two on against him, but Peralta hustled to first base to complete an inning-ending double play.

He allowed three runs and nine hits and struck out six.

McCarthy gave up five runs in his last start and appeared to be headed toward another shaky outing. He gave up two runs in the second inning and a leadoff homer by Gennett in the third, the 15th he has allowed this season.

McCarthy retired 13 of the next 14 batters he faced, though, and was helped along by three double plays.

Left fielder Gerardo Parra had the best of the bunch in the third inning, diving to rob Ramirez of a hit and throwing out Braun at second after he thought the ball was going to fall for a hit. Second baseman Aaron Hill also made diving stop up the middle to get Mark Reynolds in the seventh inning.

McCarthy came out to start the eighth, but was lifted when the Brewers sent up a left-handed pinch-hitter. He allowed three runs and seven hits.

NOTES: A moment of silence was held before the game to honour Hall of Famer Tony Gwynn, who died Monday from cancer at 54. ... The Brewers started Elian Herrera in centre field to give Carlos Gomez a night off. Gomez has reached base in 30 straight games. ... Arizona's Paul Goldschmidt extended his hitting streak to 10 games with a single in the first inning. ... Arizona LHP Wade Miley will start Tuesday in the second game of the series against RHP Kyle Lohse.