McGehee's sacrifice fly in the 10th inning scored Ed Lucas, giving Miami a 3-2 comeback victory over the Pirates in front of a Father's Day crowd of 25,952 at Marlins Park.
A former Pirate, McGehee drove in all three Marlins runs, including a tying two-run double with two outs in the eighth inning.
"We talk about him a lot and how big he's been hitting behind Giancarlo," Marlins manager Mike Redmond said. "If they continue to walk [Stanton] in situations, I feel so comfortable having him back there."
Miami ended its losing streak at three games and salvaged the series finale while improving to 35-33.
McGehee's heroics were set up by a gutsy at-bat by Rafael Furcal, who singled after he fouled a pitch off his left knee.
In pain, Furcal singled to center to open the inning against reliever Jared Hughes.
"I told them, 'I want this at-bat. I'm feeling pretty good in that situation,'" Furcal said. "I'm starting to see the ball better. I'm taking it easy more at home plate, seeing more pitches. Maybe this will help me get on track."
After the hit, Furcal ran gingerly to first base, and he gave way to pinch-runner Lucas.
Lucas moved to second on Reed Johnson's bunt, prompting the Pirates to do the expected. They intentionally walked Stanton, bringing up McGehee.
McGehee is certainly used to seeing teams pitch around Stanton, who paces the National League in home runs (18) and RBIs (54). On Friday night, the Pirates intentionally walked Stanton in a one-run game with two outs and runners at the corners. McGehee drew a bases-loaded walk to force extra innings.
Pittsburgh prevailed that night, 8-6, in 13 innings.
"If they're going to walk Stanton to load the bases the first night, put the winning run at second base, I'm pretty sure it's going to be the same thing [today]," McGehee said.
McGehee is well beyond having his feelings hurt when teams opt to pitch to him.
"If the season ends today, you'd be hard pressed to find someone more deserving of the MVP than Stanton," McGehee said. "I get that. It's smart baseball to walk him in that situation."
Hughes' wild pitch made McGehee's job easier, because it moved two runners into scoring position with one out.
On a 2-2 pitch, McGehee lifted a liner to right field, deep enough that Gregory Polanco had no play.
"I'm just trying to get the ball up in the air out of the infield right there," McGehee said. "I know Hughes has got a pretty good sinker. You've really got to make him get the ball up. Thankfully I was able to fight it off and deep enough to get Eddie in."
In the eighth inning, McGehee's two-out, two-run double off Tony Watson tied the score.
McGehee leads the Majors with 30 hits with runners in scoring position, and his 43 RBIs are tops among National League third basemen. He has also hit safely in 10 straight games.
The Marlins rejoiced in their sixth walk-off and 12th comeback win.
Mark down the 10th as one of the more remarkable, and improbable, innings of the season. Before the Marlins came to bat, A.J. Ramos had to work out of a huge bases-loaded mess with no outs. It took 33 pitches to do so.
Ramos put himself in a bind by walking Starling Marte to lead off the 10th, and Marte moved to third on Andrew McCutchen's single to left. Ike Davis walked, and the Pirates were knocking on the door to claim the lead. But with the count full, Ramos got Russell Martin to bounce to third, and Miami turned a 5-2-3 double play. With runners on second and third and two outs, Pedro Alvarez was intentionally walked. Ramos put out the fire by striking out Clint Barmes.
"I was all over the place to begin with," Ramos said. "When the bases got loaded, I just zoned in. I made the pitches I needed to make to get out of the inning."
The late drama overshadowed a solid start by Henderson Alvarez, who gave up just two runs in seven innings a week after he sustained a strained left hip against the Cubs at Wrigley Field. The injury occurred in the sixth inning in a no-decision on June 8.
"Thankfully I was able to go seven innings and keep the game close," Alvarez said.
Alvarez trailed by two runs because Pittsburgh's Vance Worley, in his first big league start of the season, threw seven scoreless.
"I was just grateful for the opportunity," said Worley, who had been at Triple-A.
After Worley exited, the Marlins were able to scratch out enough runs to complete their walk-off comeback.
"Henderson did a good job of minimizing what he gave up to give us a chance," McGehee said. "We just kept playing and gave ourselves a chance. Today was one of those days it worked out."