PHILADELPHIA -- Giancarlo Stanton hit his major league-leading 47th homer as the Miami Marlins rallied from a five-run deficit and reached the .500 mark with a 9-8 victory over the Philadelphia Phillies Thursday.
Stanton hit his latest homer in the third inning off Jake Thompson before the Phillies took an 8-3 lead.
A.J. Ellis started the comeback with a two-run homer in the fifth, Christian Yelich hit a solo homer in the sixth and J.T. Realmuto hit a two-run inside-the-park homer to tie the game in the sixth.
Realmuto's homer hit off the angled center field wall and rolled away from two Philadelphia outfielders.
After hitting his second career inside-the-park homer, Realmuto drove in the tiebreaking run with a sacrifice fly in the eighth off Luis Garcia (1-4).
The Marlins won three of four from the Phillies and reached .500 for the first time since April 27.
Miami's bullpen was strong in relief of Vance Worley, who gave up eight runs in four innings of work. Five different relievers threw an inning each, limiting the Phillies offense to three hits and no runs.
Jarlin Garcia (1-2) threw a perfect seventh inning, striking out two, for his first major league win. Brad Ziegler pitched the ninth for his eighth save of the season, all of which have come this month.
Rookie Rhys Hopkins drove in three runs and hit his eighth homer for the Phillies. Tommy Joseph also homered and drove in three runs while rookie Nick Williams drove in the other two runs for Philadelphia.
Thompson allowed five runs and seven hits in five innings after being recalled from Triple-A Lehigh Valley before the game.
The Marlins took a 1-0 lead when Stanton scored on a ground-rule double by Marcell Ozuna after Williams lost the ball in center field.
Stanton put the Marlins up 2-1 when he homered to center field. The Marlins went up 3-1 on an RBI single by Derek Dietrich.
NOTES: To make room for RHP Jake Thompson on the roster, the Phillies optioned RHP Ricardo Pinto to Triple-A Lehigh Valley. ...Phillies LF Rhys Hoskins hit his eighth home run, tying him for the MLB record amongst all players in their first 15 games. ... The Phillies next welcome the defending World Series champion Chicago Cubs to town for a three-game series Friday. Philadelphia RHP Jerad Eickhoff (3-7, 4.46 ERA) will face Chicago LHP Jose Quintana (8-10, 4.27) in the series opener. ... The Marlins will head home for a three-game series against the San Diego Padres on Friday night has Miami LHP Adam Conley (6-5, 4.93) against San Diego LHP Travis Wood (3-4, 5.81).