Stanton's two-run homer was his 12th of the year but his first since May 8. It came during a four-run first inning.
Miami (17-29) began the night tied for the worst record in the majors, and won for only the fourth time in the past 16 games. The Marlins have scored 29 runs in their past three victories.
The Angels (25-26), who began the game with a .500 record for the 11th time this season, have lost their past three games.
Angels pinch hitter Nolan Fontana homered for his first career hit in the ninth.
A.J. Ramos entered the game with two out and one on in the ninth to retire Mike Trout on a 400-foot flyout for his fifth save.
Jesse Chavez (4-6) allowed five runs in 3 2/3 innings, his shortest start of the year. His ERA rose to 5.09.
Los Angeles reliever Bud Norris consulted with a trainer and departed after throwing only three pitches in the ninth.
The Angels became the final MLB team to play at Marlins Park, which opened in 2012.
Angels manager Mike Scioscia ordered a two-out intentional walk in the sixth so left-hander Jose Alvarez could face Bour, a left-handed hitter. Bour spoiled the strategy with a homer to put Miami ahead 8-3.
It was his fourth homer off a lefty this year.
Angels: CF Cameron Maybin was held out of the starting lineup because of a sore right knee but hopes to play Saturday. ... Albert Pujols started at 1B even though he has been nursing a sore right hamstring. He looked gimpy running out a standup double in the sixth.
Marlins: CF Christian Yelich (hip) was back in the starting lineup after missing one game. ... LHP Jeff Locke (left shoulder tendinitis), who has been on a rehab assignment, is on the verge of joining the rotation and making his season debut, manager Don Mattingly said. ... SS Adeiny Hechavarria (left oblique) and 3B Martin Prado (right hamstring) are about 10 to 14 days from going on rehab assignments, Mattingly said.
RHP J.C. Ramirez (4-3, 3.81) is scheduled to start Saturday for the Angels against RHP Vance Worley (0-1, 6.75).
More AP baseball: https://apnews.com/tag/MLBbaseball