Stanton hit his 48th and 49th home runs and drove in five runs for the Marlins, who have won five of their last six. He has hit 16 home runs in August and his multi-homer performance was his ninth of the season. Stanton also tied a career high of 105 RBIs set in 2014.
Marcell Ozuna's three-run home run off Padres reliever Kirby Yates (3-5) in the seventh erased a 6-5 deficit. Ozuna reached 30 home runs for the first time in his career. He also accomplished 100 RBIs for the first time as his blast gave him a career-best 101.
With the victory, the Marlins (64-63) surpassed .500 for the first time since April.
Jabari Blash's two-run homer off McGowan capped a four-run sixth and gave the Padres (57-71) a 6-5 lead. McGowan relieved starter Adam Conley to face Blash, who drilled McGowan's pitch deep past the wall in center field for his fourth home run.
Conley couldn't hold a three-run lead entering the inning and surrendered Jose Pirela's run scoring single and Will Myers' sacrifice fly before being lifted for McGowan. He allowed five runs, six hits and struck out four.
Padres starter Travis Wood pitched the first five innings and allowed Stanton's home runs. Wood surrendered five runs and nine hits while striking out three.
The Marlins struck quickly on Stanton's two-run homer in the first. Stanton drilled Wood's pitch 462 foot past the left field stands into the walkway.
Stanton victimized Wood again in the third when his opposite-field solo home run increased Miami's lead to 3-0. Blash leaped above the wall in an attempt to catch Stanton's shot but it landed in the right-center field seats.
The Padres reduced the deficit on Carlos Asuaje's two-run home run in the fourth. Asuaje's shot off Conley landed in the Marlins' bullpen in right-field for his third homer of the season.
Stanton gave Miami another three-run advantage after his bases-loaded two-run double in the fifth.
NOTES: The Marlins held a brief video tribute and moment of silence for Rafael "Felo" Ramirez before Friday's game. Ramirez, the club's lead Spanish-language play-by-play broadcaster since its inception in 1993, died Tuesday. Ramirez, whose broadcasting career spanned 72 years, was 94. ... LHP Wei-Yin Chen threw 12 pitches during a rehab assignment in the Marlins' Gulf Coast League affiliate game Friday in Jupiter, Fla. Chen has been sidelined with fatigue in his pitching elbow since early May. ... Since being acquired from Kansas City July 24, Wood has pitched at least five innings in each of his six starts for the Padres. ... Blash played two seasons of collegiate baseball at Miami-Dade College before being selected in the 2010 draft.