They even boxed in the dugout to celebrate.
Fernandez improved his Marlins Park record to 26-1, and Stanton drilled a massive two-run, go-ahead homer to lead Miami to a 7-2 win over New York.
The Marlins (53-44), who are second in the National League East, banged out 16 hits and moved 1 1/2 games ahead of the Mets (51-45) in the division race. The Washington Nationals lead the division by 4 1/2 games.
"Man, this is so fun to watch," Fernandez said. "I've never been a part of a team like this."
Stanton went 4-for-5 with three RBIs for his first four-hit game since August 8, 2012. One of his crushed line drives, on a single, was clocked at 118 mph. Stanton also has five homers in his past three games against the Mets.
His third-inning homer down the left-field line bounced off the scoreboard about 50 feet up. Unimpeded, the ball was projected to have traveled 441 feet.
After Stanton returned to the dugout, many of his teammates started playfully punching him.
"I wanted to punch him hard, but I was afraid I was going to hurt my hand," Fernandez said. "It's an honor (to play with Stanton). Every time he comes to the plate, you don't know if he's going to hit it 10,000 feet."
The Marlins surely feel honored to play with Fernandez (12-4, 2.54 ERA), who went seven innings, allowing seven hits, two walks and two runs. He struck out six and improved his career home ERA to 1.47.
Offensively, Fernandez singled and drove in a run in the second inning and singled and scored a run in the fourth.
Losing what was supposed to be a pitching duel was Jacob deGrom (6-5), who lasted just 3 2/3 innings -- the second shortest outing of his career.
"I wasn't very good today -- seemingly everything I threw went down the middle, and I paid for it," said deGrom, who allowed five runs, 10 hits and one walk. "It doesn't help when you throw 30 pitches an inning."
Upset with himself, deGrom wasn't in the mood for a question about Stanton.
"I saw him hit a ball pretty far over the wall," deGrom said. "I don't know what you want me to say."
In truth, there was little the Mets could say about their performance, and Miami started its barrage early.
With none on and two outs in the second inning, the Marlins rallied to score the game's first run. Adeiny Hechavarria doubled off the wall in right-center and scored on a Fernandez single that just got under Jose Reyes' glove at third base.
DeGrom got even in the third as his leadoff double down the right-field line led to a two-run rally and a 2-1 Mets' lead. Curtis Granderson singled, Yoenis Cespedes had an opposite-field RBI single and James Loney capped the scoring with a sacrifice fly.
Miami regained the lead at 3-2 in the bottom of the third on Stanton's two-run homer. It was his 21st long ball of the season.
"That was one of those pretty ones," Marlins manager Don Mattingly said of Stanton's blast. "That was a long one."
Fernandez got his second hit of the night to lead off the fourth, and when he came around to score on another Stanton single, and that was it for deGrom.
"Even when I was at the plate," said Fernandez, who is hitting .265 this season, "I was ready to do whatever I could to win the game."
The Marlins then made it 5-2 later in the inning when Derek Dietrich drew a bases-loaded walk off reliever Seth Lugo.
Miami's Martin Prado capped the scoring with RBI singles in the fifth and seventh innings.
But the offensive damage had been done early, mostly by Stanton.
"He's a great player," Mets manager Terry Collins said of Stanton. "He had a rough start (this season). That's part of the game.
"But if you make pitches, you can get anyone out. You can put whatever name on it. I saw (Barry) Bonds. I saw them get him out, too. You just have to make better pitches."
NOTES: Marlins OF Ichiro Suzuki grounded out as a pinch hitter in the eighth. He is still four hits shy of 3,000. ... The top four NL teams in the wild-card playoff race -- the Marlins, Mets, St. Louis Cardinals and Los Angeles Dodgers -- started Saturday tied in the loss column (44). ... Marlins 1B Justin Bour, who went on the disabled list on July 6 due to an ankle sprain, said he is "1,000 percent" ready in terms of hitting but needs some work on defense and baserunning. Bour, who has 15 homers, should start a minor-league rehab assignment in a couple of days and could return next week. ... Mets 1B Lucas Duda (back) is about two weeks away from a minor-league rehab assignment. ... Mets LHP Steven Matz, who starts against the Marlins on Sunday, is 0-5 with a 4.79 ERA in his past nine outings. Miami will counter with RHP Jose Urena (1-1, 7.52) in the series finale.