The Padres hit Fernandez hard throughout his five-plus innings.
"I think we had a great approach to get on his heater early," Gyorko said. "It kind of got him off a little bit."
This game looked like a mismatch coming in. San Diego had the worst offense in the majors, averaging just 2.6 runs per game, and Fernandez had dominated the Padres in two previous starts.
The right-hander won both starts by giving up just five hits in 14 2/3 scoreless innings with 18 strikeouts.
"You get a pretty good indication how he throws on the first couple of swings and the guys were on him pretty good," Marlins manager Mike Redmond said. "Sometimes that just happens."
Fernandez (4-2) was charged with six runs and six hits in five-plus innings. The right-hander, who won the NL Rookie of the Year award last season, was 2-0 with a sparkling 0.60 ERA in his previous four starts.
The Padres snapped a three-game losing streak. It was their highest-scoring game since a 12-2 victory over Arizona on Sept. 25.
San Diego sent 11 men to the plate during a six-run sixth inning that broke it open. The Padres’ previous high for runs in a single game this season was six.
Tyson Ross (4-3) was working on a shutout before Marcell Ozuna homered in the seventh inning. The righty allowed four hits and struck out eight in seven innings.
Tim Stauffer and Kevin Quackenbush each pitched an inning to close out the combined four-hitter.
San Diego won for just the third time in 10 games and snapped the Marlins’ five-game winning streak.
Gyorko’s fourth homer in the second came after Yasmani Grandal reached on a throwing error by first baseman Garrett Jones.
Everth Cabrera sparked the Padres’ biggest scoring inning of the season with a leadoff single in the sixth. Seth Smith singled and Grandal walked to load the bases for Gyorko, who turned on a 2-0 fastball and hit it into the second deck of the Western Metal Supply Building down the left-field line.
It was Gyorko’s second career multi-homer game and his second grand slam.
NOTES: Marlins RHP Carlos Marmol was struck in the back by a ball off Kyle Blanks’ bat while stretching during San Diego’s batting practice. Marmol said he was fine. … Barring an injury, Padres 3B Chase Headley (strained right calf) will be activated from the 15-day DL on Saturday. Headley was scheduled to play Friday night with Single-A Lake Elsinore. … The San Diego State men’s basketball team that won the Mountain West Conference regular-season title and reached the Sweet 16 in the NCAA tournament was honored before the game. … Marlins RHP Nathan Eovaldi (2-1, 2.78 ERA) opposes Padres LHP Eric Stults (1-3, 5.40) on Saturday night.