McGehee and Marcell Ozuna hit back-to-back homers with two outs in the ninth inning off Brewers closer Francisco Rodriguez, who got two quick outs to open the frame before walking Giancarlo Stanton. After Stanton stole second, McGehee ripped a 1-0 pitch over the wall in left-center for his fourth home run of the year to put Miami up 5-3. Ozuna followed with his 21st homer.
"'G' had a great at-bat to walk, steal a base and then Casey. I can't say enough about that guy," Marlins manager Mike Redmond said. "We talked about him not hitting a lot of home runs, so if there was ever a time for him to hit a big home run, today was it. That was nice. It was a nice feeling."
Rodriguez, who has had little opportunity to add to his 39 saves during the Brewers' recent slide, was more upset with the walk to Stanton than the home runs.
"Definitely, I lost it," Rodriguez said. "I was in the situation, exactly where I wanted to be. Right where I wanted to get, the first two guys out and keep them off the bases. You pick your own poison right there. Stanton is the last guy, obviously, I don't want to get hurt. Once I got back into the count, 2-2, I still had two pitches to make -- quality pitches -- and I didn't.
"In my opinion, I lost that game with the 2-2 count."
The Marlins entered the ninth tied thanks to reliever Bryan Morris, who escaped a bases-loaded, none-out jam in the eighth. Milwaukee loaded the bases on a single by Khris Davis, a walk to Lyle Overbay and an error when Morris mishandled Jean Segura's sacrifice bunt attempt.
But Morris got Rickie Weeks and Carlos Gomez to bounce to third -- where McGehee threw home both times for the forceout -- and then retired Scooter Gennett on a flyout to right.
"You don't ever want to be in that situation, but if you've got to be in it, I'll take my chances with B-Mo being able to at least give us a chance right there," McGehee said. "He made pitch after pitch with his back against the wall. You're not going to get out of that spot too often, but that was huge."
After Brewers starter Matt Garza left after throwing 84 pitches through four innings, the Marlins snapped a 2-2 tie with a run in the sixth off Jeremy Jeffress. Ozuna drew a one-out walk and Garrett Jones followed with an RBI double to center.
Milwaukee pulled even with a run in the seventh on a double by Gennett and a two-out RBI single by Aramis Ramirez.
One night after crushing three home runs, the Marlins used baserunning to manufacture a pair of runs in the third. Christian Yelich singled to open the inning, stole second and scored on Donovan Solano's slicing single down the right-field line.
After Solano was erased on a double play, McGehee walked. Although Garza had the ball on the mound, McGehee, hardly known for his speed, broke for second and appeared to be an easy out. But Garza, who has a history of the yips when throwing to bases, bounced the short toss past second baseman Gennett and into center field, allowing McGehee to reach. Ozuna then singled home McGehee with the unearned run to make it 2-0.
"Garza, he's a tough guy to string a bunch of hits together against, and with two outs, I figured if I could try to time him up and maybe get myself in scoring position and maybe make O's job a little bit easier," McGehee said. "I thought I had a rhythm that I could kind of take advantage of. Apparently I was pretty far off on my timing.
The Brewers tied it in the bottom of the inning on an RBI double by Ramirez and run-scoring groundout by Gerardo Parra.
The Marlins wasted an opportunity in the seventh after loading the bases with two outs, as lefty Zach Duke struck out pinch-hitter Jeff Baker to end the inning.
"We've had some tough losses, and it's nice to get on the other end and have a big win," Redmond said. "An emotional win in a game where it looked like maybe we were going to be able to hang on and win by one. They tied it up, but we were able to stay in there and make some big pitches and come out with a big win."