The loss dropped the Angels back into a tie for the AL West lead with Oakland, which won 8-2 in Houston.
Stanton and Trout entered the final interleague series of the season for both clubs leading their respective leagues in extra-base hits and total bases. Stanton also tops the NL in homers, RBIs, on-base percentage and slugging percentage. Trout, runner-up in AL MVP voting each of the past two seasons, was this year's All-Star game MVP.
"It's cool, but I wasn't anticipating it or circling it on the schedule or anything like that," Stanton said. "I was looking forward more to seeing my family than seeing him."
Jarred Cosart (2-1) allowed a run and seven hits over 7 2/3 innings. He struck out four in his fourth outing since he was acquired from Houston at the July 31 trade deadline. The right-hander, who was 9-7 with the Astros, lost his shutout bid in the eighth on an RBI double by Kole Calhoun.
"I tried to attack the strike zone, first and foremost," Cosart said. "That's one of the best lineups in the game, and you know the names on the backs of the jerseys in the middle of it. So if you get those guys out and get complacent, then the bottom of the order can hurt you. Then when they flip it back over, you're in a world of hurt."
Christian Yelich, a native of Thousand Oaks, California, and a product of the baseball camp run by Angels manager Mike Scioscia, was 3 for 5 with a pair of RBI singles and a double.
"I think I was 8 or 9 when I want to his camp, so it's been a while. There were a lot of kids at those things, so I didn't think he would have any idea," Yelich said. "It was kind of weird today, stepping in the box and looking in the other dugout, and he was sitting right there. I just remember him giving speeches and stuff. It ended up paying off."
Wade LeBlanc (0-1) was charged with six runs and seven hits in 3 1/3 innings as a replacement for Garrett Richards, out for the season because of a torn patellar tendon in his left knee that occurred last Wednesday in Boston. This was LeBlanc's first big league start since May 6, 2013, when he lost at San Diego while pitching for the Marlins.
"The first time through the order was pretty smooth, but they did a good job making adjustments -- and obviously I didn't," LeBlanc said. "I knew the adjustments I needed to make, and I just didn't execute them. That's a good hitting ballclub over there, and they're pretty hot right now. I didn't give this team much of a chance at all."
The Marlins opened the scoring with a three-run third and made it 7-0 in the fourth with Stanton's 33rd homer, a line drive to left-center off Cory Rasmus that increased his RBI total to 97. It was the 150th career homer for the two-time All-Star right fielder, four shy of Dan Uggla's franchise record.
"The difference between a four-run game and a seven-run game is like night and day, because they can put up four runs in an inning with no problem," Stanton said.
SHUFFLING THE DECK
Marcell Ozuna started in the cleanup spot for Miami for the first time this season and was 0 for 4 with a sacrifice fly. Reed Johnson was the designated hitter and singled his first two times up, leaving him one hit short of 1,000.
Marlins: 1B Jeff Baker, who came out of two games during the series at Colorado because of sinus problems related to the mile-high altitude, was back in the lineup and went 0 for 5 with three strikeouts.
Angels: Scioscia said LHP Joe Thatcher is throwing off a mound, but is not quite ready for a minor league rehab assignment and probably won't be activated from the disabled list on Sept. 1 when rosters expand. He hasn't pitched since Aug. 2 because of a sprained left ankle.
Marlins: Nathan Eovaldi (6-8, 4.06 ERA) is 1-5 with a 4.91 ERA in his last 10 starts. All three of his victories since May 26 have come on the road.
Angels: Matt Shoemaker (12-4, 3.56 ERA) looks to win his fourth straight start after taking a no-hitter into the seventh inning of his 2-0 triumph last Thursday in Boston. He is two wins from tying the franchise rookie record, shared by Dean Chance (1962), Marcelino Lopez (1965) and Frank Tanana (1974).