After pinch-hitter A.J. Ellis grounded into a forceout at the plate, Gordon lined a single to right-center for the Marlins' fourth walk-off win of the season.

Drew Steckenrider (1-1) pitched a scoreless 10th for his first career victory.

Leiter was optioned to Triple-A Lehigh Valley after the game.

The Marlins nearly won in the ninth after loading the bases with one out. After Christian Yelich struck out, Marcell Ozuna hit a liner off the leg off reliever Hector Neris, and the ball rolled right to first baseman Tommy Joseph.

"It wasn't enough to get us (over the top)," Stanton said. "It was good that we showed pop today and were able to score some runs."

Justin Bour's two-run homer in the fifth was his 21st and put the Marlins ahead 5-4.

"Honestly I wasn't worried about those two homers (to Stanton), those are going to happen," Phillies pitcher Jerad Eickhoff said. "It was the Bour homer that I was most frustrated with."

Philadelphia tied it in the seventh off Kyle Barraclough on a sacrifice fly by Cesar Hernandez, who played in his first game since June 9. Hernandez, sidelined by a left oblique strain, went 1 for 3 with a walk, scored a run and drove in one.

The Phillies loaded the bases in the eighth, but reliever David Phelps struck out Brock Stassi and pinch-hitter Daniel Nava.

"That eighth inning was tough with bases loaded, a couple strikeouts," Mackanin said. "We had a good opportunity to score then."

PERKINS WITH AN IMPRESSIVE CATCH

Philadelphia left fielder Cameron Perkins made a leaping catch up against the wall on a flyball by Stanton in the seventh despite colliding into center fielder Odubel Herrera. The two fell to the ground with Perkins still holding onto the ball.

"I was about to go for the inside-the-park if he didn't make that catch," Stanton said.

DI MARIA THROWS OUT FIRST PITCH

Paris Saint-Germain star Angel Di Maria threw out the ceremonial first pitch. His soccer club will be playing in a friendly against Juventus at Hard Rock Stadium in Miami Gardens on July 26 as part of the International Champions Cup.

Phillies: OF Aaron Altherr (hamstring) was placed on the 10-day disabled list retroactive to July 15 prior to the game and will have an MRI on Tuesday. "We don't think it's anything serious," assistant general manager Scott Proefrock said. "It's just a purely precautionary MRI and we think there's a really good chance he's back by the time the 10 days are up." OF Howie Kendrick (hamstring) took part in batting practice before the game with the intentions of beginning a rehab assignment later this week.

Marlins: 3B Martin Prado (right knee sprain) was placed on the 10-day disabled list following the game. Prado exited in the fifth inning after an at-bat in the fourth. IF Miguel Rojas will be reinstated from the disabled list in a corresponding move. RHP Edinson Volquez (knee) has not pitched since July 5 and is resting before attempting to throw sometime next week. "If we can get past that, then we'll start that process," Mattingly said.

UP NEXT

Phillies: RHP Vince Velasquez (2-5, 5.58 ERA) will be re-instated from the disabled list to start Tuesday's game. It will be his first start since May 30 after suffering a right elbow flexor strain.

Marlins: LHP Adam Conley (2-3, 7.53) will make his first big league appearance since May 8. Conley is 2-1 with a 1.47 ERA in five career starts against the Phillies.