SAN FRANCISCO -- There are a host of reasons why Giants starter Matt Cain went 11 games without earning a victory before Thursday night.
Lack of run support, one too many mistakes here and there, bad luck, coincidence, you name it, seemingly conspired against Cain throughout the longest drought of his career.
On Thursday night in a 6-4 win over the Miami Marlins, Cain overcame a shaky start, then settled down the final five innings he pitched and notched his first victory since Aug. 17, 2013, when he also beat the Marlins.
"That says a lot about him," manager Bruce Bochy said of Cain overcoming two home runs and 3-0 and 4-1 deficits within the first three innings. "He didn't cave in. It wasn't a very auspicious start."
Jeremy Affeldt and Sergio Romo recorded the final four outs in relief of Cain. But, make no mistake, this win had as much to do with Cain as anyone or anything.
The Giants extended their lead over the idle Colorado Rockies in the National League West to four games with their fourth victory in five games.
For a while, it looked as if Cain was headed for his fourth loss of the season and 12th straight start without a victory.
Derek Dietrich and Garrett Jones homered in the first two innings to put Miami up 3-0. In the third, Cain escaped a second-and-third situation with one out, and the Marlins leading 4-1, without further damage.
Catcher Buster Posey called that the turning point of the game.
"Getting out of that gave him some confidence," Posey said, "and he was able to build off of that."
Cain retired 16 of 19 batters -- he allowed only one hit during this stretch -- before he allowed a two-out double in the eighth.
By that time, the Giants had turned a three-run deficit into a 6-4 lead.
"He gives up two home runs the first two innings, four runs in the first three innings, and here he is pitching in the eighth inning," Bochy said. "You don't see that very often. It says a lot about him, his makeup and his toughness."
Affeldt and Romo made certain that Cain walked into the clubhouse with a victory for a change.
"It had been a long time," said Cain, who had a 3.34 ERA during his winless streak.
The Giants were 1-5 in Cain's six starts this season, making things even worse, he said.
"I felt like I wasn't contributing," he said. "So, that was nice for these guys to come back and score some runs, then hold them there."
Marlins manager Mike Redmond pleaded his case with the umpires. He was informed that plays in front of the bases aren't reviewable.
So, instead of being out for touching a batted ball in fair territory, Pence got a second chance and made the most of his new life when he bounced a single through the right side later in the at-bat. Posey followed with a two-run double.
Pence said he had no idea where the ball was or whether it hit him in fair territory. He was focused on running hard to first.
"It was kind of a weird foul ball," Pence said. "I was just trying to throw my bat and I'm thinking, 'Don't get your bat in the way.' "
Bochy said Hudson felt tightness in his hip during that game Sunday but that he loosened up well enough to keep pitching.
Bochy finally removed Hudson from the game after six innings, and 78 pitches, as a precautionary measure.
"I'm glad we did," Bochy said.
Yusmeiro Petit will start Friday night in Hudson's place, Bochy said. Earlier this season, Petit started two games in place of injured starter Matt Cain.
Hudson, 38, has started eight games in his first season with the Giants. He is 4-2 with a 2.09 ERA. He started at least 21 games in all but one of his first 15 seasons in the majors.
"We think he'll be fine to make the next start," Bochy said, "if we do give him a few extra days here."
Miami (Henderson Alvarez 2-3)
at Giants (Yusmeiro Petit 2-1),
7:15 p.m., NBC Bay Area
Scan this code with a smartphone to view a Giants photo gallery or go to http://photos.mercurynews.com.