SAN FRANCISCO -- After two games filled flaring tempers and alleged beanballs, the Giants and Marlins finally learned to play nice together in their season series finale.
Just the way San Francisco manager Bruce Bochy expected -- or at least hoped.
"I didn't think it would continue," Bochy said. "You're going to have games like that and tempers are going to flare. Boys will be boys, as they say, but it's back to baseball."
In comparison to the games Monday and Tuesday when both teams were chippy, Wednesday's game was tame.
There were more errors than hit batters and the only damage was self-inflicted when Giants leadoff hitter Alen Hanson fouled a ball off his left knee in the first inning.
What fireworks there were came primarily in the sixth when San Francisco chased Miami starter Jose Urena (2-9).
Panik scored the go-ahead run when Mac Williamson hit a sharp grounder to third baseman Miguel Rojas with one out. Rojas made a diving stop but second baseman Starlin Castro had to stretch for the throw and was unable to make the relay to first.
Hernandez capped the inning with a two-run single after a 14-pitch at-bat against Urena.
"He really grinded out that at-bat," Bochy said. "Just came through with a huge hit there and gave us a cushion."
Derek Holland (5-7) had seven strikeouts and allowed three runs over six innings in his first start against the Marlins since 2011. He walked two and left after giving up back-to-back hits opening the seventh.
"(Catcher Nick Hundley) and I did a great job establishing what we needed to, getting ahead of hitters," Holland said. "I know the line says I gave up three runs but at the end of the day these guys did a good job of keeping the momentum on our side."
The Giants' left-hander said he changed his stance on the mound, shifting from one side of the rubber to other.
"Just wanted to do something different, that's all," Holland said.
Castro drove in a pair of runs and Brian Anderson had three hits for Miami, extending his on-base streak to a career-high 18 games.
The Marlins hit into three double plays, including when Urena was doubled up at first after mistakenly heading for third on Castro's fly ball to center with no outs in the third.
"I've never seen a guy be the leadoff hitter and then lose count of the outs," Miami manager Don Mattingly said. "He was hustling though. We had some other chances too."
"That's cute. I remember my first 14-pitch at-bat." -- Belt, who set a major league record with a 21-pitch at-bat against the Angels on April 22, talking about Hernandez's long at-bat in the sixth.
Marlins: Outfielder Garrett Cooper (wrist) was sent to Triple-A New Orleans to begin a rehab assignment.
Giants: Hanson had to be helped off the field and was diagnosed with a knee contusion after undergoing X-rays. ... Buster Posey was given the day off. ... RHP Jeff Samardzija (shoulder tightness) makes his second rehab start with Triple-A Sacramento on Thursday.
Marlins: Following a day off Thursday, Miami heads to Colorado to begin a three-game series. LHP Wei-Yin Chen (2-3, 5.91 ERA) pitches the opener seeking his second win against the Rockies this season.
Giants: LHP Madison Bumgarner (0-2, 4.67) faces San Diego on Thursday night in the opener of a four-game series. Bumgarner has lost four straight to the Padres.
More AP baseball:�https://apnews.com/tag/MLBbaseball
Craig Counsell explains his move to pull starter Wade Miley after just 5 pitches, saying that it was all part of the gameplan.
Clayton Kershaw reflects on his impressive outing after the Dodgers' 5-2 victory and discusses the importance of going back to Milwaukee with a win.
A potential two-run homer by the Astros' Jose Altuve was ruled an out by umpires, who said a fan interfered with Mookie Betts' catch attempt in ALCS Game 4.
Clayton Kershaw bounced back from one of his worst postseason starts with one of his best, pitching the Los Angeles Dodgers past the Milwaukee Brewers 5-2 Wednesday to move one win from a return trip to the World Series.
Clayton Kershaw uses his nastiest stuff to get Erik Kratz whiffing at a curveball.
Justin Turner knocks in an RBI single and Brian Dozier adds to the lead with a sacrifice groundout to make it 5-1 Dodgers in the bottom of the 7th.