MILWAUKEE -- Casey McGehee sent the ball flying. A few moments later, he gave his helmet a ride, too.
McGehee launched a pinch-hit, three-run homer in the seventh inning, then spiked his blue batting helmet in the dugout while letting out weeks of frustration, as the Brewers beat the Arizona Diamondbacks 3-1 Wednesday.
McGehee, benched three of the previous five games because of a season-long slump, hit his first home run since May 20. He had been hitting .171 since last homering.
"It definitely felt like a huge weight being lifted off my shoulder," he said. "I guess it was symbolic of that."
McGehee's inability to come through in the clutch prompted the move to the bench.
"It's been a long time coming to feel like I came up in a big spot and was able to have some success, and have a big at-bat for us," he said. "I felt like it had been a long time coming. It was kind of a release, I guess."
Reliever Joe Paterson (0-2) struck out Prince Fielder to start the seventh before giving up consecutive singles. Sam Demel came on to face McGehee, who hit a 3-2 pitch off the slight overhang in center field for his third career pinch-hit home run and second this season. The other was April 10 against Chicago.
"He had a great at-bat," said Demel, who gave up his first earned run in 19 games. "Everything I threw him, he was getting a piece of. I tried to get a two-seam sinker down and over the plate and I got it up a little bit."
Yovani Gallardo (10-5) pitched seven strong innings, giving up a run and four hits, and helped prevent Arizona from sweeping the Brewers for the first time. He had lost three of his past four decisions, allowing 14 runs in 28 innings over that stretch.
Against the Diamondbacks, Gallardo was more like the pitcher who won six consecutive starts earlier this season. He gave up a leadoff home run to Kelly Johnson on his third pitch of the game, but quickly recovered and struck out six, walked one and retired 13 of 14 batters during one stretch.
Gallardo said that he was just trying to get that first strike after falling behind.
"I left it out over the plate," he said about his only mistake in the game. "After that, I just made sure that it was very important to get ahead in the count and then work from there."
Gallardo became the sixth NL pitcher with double-digit victories. He threw a season-high 123 pitches-79 strikes in what was his last start before the All-Star Game.
"After that first hitter, Yo was pretty much lights out," McGehee said.
Arizona rookie Josh Collmenter pitched six shutout innings, allowing three hits. He had lost his last four starts.
The Brewers' offense was all McGehee as the rest of the team struggled, especially with All-Star Ryan Braun missing his fourth consecutive with a sore left calf.
Johnson hit his ninth career leadoff home run. ... All-Star second baseman Rickie Weeks made a nice diving catch in the third to rob Johnson of a hit up the middle. ... Roenicke came out to check on Gallardo before he faced Juan Miranda with two out in the seventh. The right-hander, who already had thrown 116 pitches, stayed in the game and struck out Miranda.