SAN FRANCISCO (AP) — The offense has made up for poor starting pitching during some of the San Francisco Giants' recent surge and did just enough to get back in the game Friday night.
It just couldn't do anything to erase the bullpen's blunders.
Casey McGehee singled home the winning run off Santiago Casilla with one out in the ninth inning, and the road-weary Miami Marlins beat the Giants 7-5.
"I don't know what a normal loss is. It's a loss," Giants manager Bruce Bochy said. "We've been playing well and we'll put this behind us. You are going to have games like this that don't go your way."
The NL West-leading Giants fell behind 4-1 for the second straight night to the Marlins but couldn't finish off another home comeback this time.
Casilla (1-1) got out of a bases-loaded jam in the eighth but couldn't escape trouble in the ninth. The right-hander allowed two baserunners before McGehee's tiebreaking grounder to right field.
"It just had eyes and got through the infield. That's the way the game goes," Bochy said.
Garrett Jones added an RBI single off lefty Javier Lopez and made a leaping catch in the netting of the photographers' pit in foul territory in the ninth. Mike Dunn (4-3) pitched a scoreless eighth, and Steve Cishek converted his eighth save for Miami.
Derek Dietrich and Christian Yelich homered, and Jarrod Saltalamacchia snapped an 0-for-26 skid by tying his career high with four singles to stop Miami's slide. The Marlins entered the game losers of six of their past seven games and a majors-worst 4-16 record away from home.
They also are a league-best 17-5 at home.
"We've seen those games go the other way sometimes, especially on the road right now. It was huge for us to be able to stick in there and get that one," McGehee said.
Neither starter pitched well but did just enough to give his team a chance in the final innings.
Henderson Alvarez allowed five runs — four earned — and 10 hits in six innings for the Marlins. He struck out four and walked none.
Giants right-hander Yusmeiro Petit, filling in while Tim Hudson rested his nagging hip, gave up five runs — four earned — and seven hits in five innings. He struck out five and walked none.
"I lost a little bit of my command in the first inning. I tried to stay close in the game," Petit said.
The Giants had three run-scoring hits with two outs, including pinch-hitter Gregor Blanco's bloop single in the sixth that tied it at 5-all. Blanco's hit came after McGehee couldn't corral a grounder at third.
"I still feel terrible. Alvarez battled through and it would've been nice to get him the win," McGehee said.
Defense — or a lack thereof — proved pivotal in the late innings.
Marlins manager Mike Redmond successfully challenged a transfer rule call in the fifth. After a replay review, umpires ruled Marlins right fielder Giancarlo Stanton caught Hunter Pence's fly in the web of his glove and dropped the ball trying to transfer it to his hand for a throw.
Buster Posey's fly out to right later scored Angel Pagan, who had advanced to third on Stanton's botched transfer. Stanton made up for the play with an outstretched catch of Michael Morse's fly near the wall in the eighth.
Pagan also made a spectacular over-the-head catch on Dietrich's deep fly for the first out of the seventh and held on after running into the padded wall in left-center. And Casilla got pinch-hitter Ed Lucas to ground into a double play with the bases loaded to end the eighth.
NOTES: It was the fifth time Saltalamacchia had four hits in a game. ... Stanton's career-high 17-game hitting streak ended after going 0 for 5. ... San Francisco hosted "Metallica Night," which included members of the heavy metal band playing the national anthem, drummer Lars Ulrich throwing out the ceremonial first pitch and singer James Hetfield announcing San Francisco's starting lineup. ... RHP Tim Lincecum (3-2 4.78 ERA) starts for the Giants opposite Miami's RHP Tom Koehler (3-3, 2.57) on Saturday.