SAN FRANCISCO -- For the second straight night, the D-backs watched another lead slip away to the Giants in the late innings.
But instead of another deflating defeat, the D-backs wound up walking away with a 6-4 win in 11 innings.
First things first: D-backs starter Patrick Corbin wound up with a no-decision, but the 23-year-old deserved better.
Corbin allowed just two earned runs, did not walk a batter and fanned seven over 7 1/3 innings and was in position to win his third game of the year.
"He was money," catcher Miguel Montero said. "He threw really good."
While Corbin was handling things on the mound, his teammates got things going at the plate.
The D-backs jumped on Giants starter Matt Cain for a pair of runs in the first inning thanks to a bloop RBI double by Paul Goldschmidt and a run-scoring groundout by Montero.
Goldschmidt, who seems to feast on Giants pitching, was once again in the middle of the offense in the third, when he blasted a two-run homer to give the D-backs a 4-0 lead.
Cain's struggles this season continued as he allowed four runs (three earned) on five hits over six innings.
After the third, though, the D-backs' bats went quiet.
Still, Corbin kept the Giants off the board, getting ahead in the count with an effective mix of his fastball, slider and changeup.
Finally in the eighth, the Giants broke through as they cut the lead in half with a two-run rally.
Still the D-backs led, 4-2, with closer J.J. Putz coming on to start the ninth.
Hunter Pence greeted him with a double to the gap in left-center and pinch-hitter Brandon Belt, who had the game-winning pinch-hit Monday, then delivered a game-tying two-run homer.
The pitch was a 2-2 split-finger fastball that stayed up in Belt's wheelhouse, and he hit it on one bounce into McCovey Cove.
"Just hung it and he put a good swing on it," Putz said. "If I throw it where I want it, it's a totally different outcome."
Where Putz wanted to put it was in the dirt. Last week in New York he tried to do something similar with a split to Francisco Cervelli, and that one, too, got left up and the Yankees catcher hit it for a game-tying homer.
"Going through a rough patch," said Putz, who has blown three saves this season. "I've been there before, I'll get over it. That's pretty much it."
But it wasn't it for the D-backs.
The Giants had a chance to win it in the 10th when Pablo Sandoval doubled with two outs. Reliever Brad Ziegler then walked Buster Posey intentionally and Pence singled sharply through the hole to right. Arizona right fielder Cody Ross fielded the ball cleanly and threw a strike to Montero to nail Sandoval by a good 20 feet.
"You get a two-out hit, you're trying to score," Giants manager Bruce Bochy said. "Ross charged it well, threw a bullet home and he was out. That's part of the game. They're going to have to make good plays. We got the hit we were looking for; they had to make a great throw."
It would be a baserunning play that would help the D-backs win things in the 11th.
With one out, Didi Gregorius lifted a ball to left, and when Andres Torres took his time throwing the ball in, Gregorius hustled into second with a double.
"Out of the box I was hustling trying to get into second and get into scoring position right away," Gregorius said.
Gregorius moved to third when pinch-hitter Alfredo Marte reached on an error by Belt at first, and Gregorius came home to score on a wild pitch.
"I was getting a lead and Matt told me to be ready just in case he throws something in the dirt and be aggressive and take it," Gregorius said, referring to third-base coach Matt Williams.
Gerardo Parra then doubled home Marte to give the D-backs an insurance run as Matt Reynolds closed the door to pick up his first career save.
In the end, it all worked out, but manager Kirk Gibson knows the D-backs must do a better job of holding on to late-inning leads.
"It's a shame Patrick didn't get that win," Gibson said. "We've got to clean that up."
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.