Derek Dietrich drove in a run and scored one for the Marlins, who have won five straight.
Jacob Turner gave up just one run on five hits with a walk and four strikeouts over six innings. A.J. Ramos (3-0) got the win for working two scoreless innings.
Ian Kennedy struck out 12 over seven innings in the start, giving up a run on four hits. He also hit a solo home run to account for the offense for the Padres, who have lost their last three. Dale Thayer (2-1) took the loss for giving up the homer in the 11th.
San Diego relievers had retired 11 straight batters before Dietrich reached base when his grounder to second was misplayed by Jedd Gyorko. Stanton followed with a crush of an 0-2 pitch over the wall in center for a 3-1 lead.
Steve Cishek set the Padres down in order in the bottom of the 11th for his seventh save of the season.
San Diego left the bases loaded in the first, but got on the board in the second inning when Kennedy launched a two-out solo home run to left-center, the first of his career.
Kennedy was cruising through the start as he set down the first 14 batters he faced, striking out nine, before Garrett Jones doubled with two outs in the fifth. Marcell Ozuna flied out to end the frame.
In the sixth, though, the Marlins tied the game as Christian Yelich doubled with two outs and scored on a Dietrich single to right. The Marlins loaded the bases on walks to Stanton and Casey McGehee, but Jarrod Saltalamacchia struck out to end the frame.