PHOENIX -- Brandon Belt stood at his locker before Wednesday night's game and talked at length about how he felt close to getting on one of the torrid tears that tend to follow his slumps.

Arizona Diamondbacks right-hander David Hernandez might have given Belt the push he needed. The reliever grooved a fastball with two on, two outs and two strikes in the eighth inning, and Belt crushed it, erasing a two-run deficit and leading the Giants to a 9-6 victory.

"I feel close," Belt said. "But I'm definitely not as consistent as I need to be."

The Diamondbacks would certainly disagree. In six games against the N.L. West rivals this season, Belt is 7 for 17 with three home runs and nine RBIs. Three of his hits have been game-winners.

"He's just been really clutch for us," right fielder Hunter Pence said. "He got sick early (this season), and it just seemed like he was in such a big hole, but he's climbed out of it."

Pence might have left a hole in a wall beyond the center-field fence with a homer that traveled an estimated 460 feet and was part of another furious Giants comeback to overcome a rough pitching performance.

Tim Lincecum has had trouble with big innings this season, and Cliff Pennington continued that theme in the second inning. With two on, Pennington hit a fastball into the pool area beyond the right-field fence, giving the Diamondbacks a 3-1 lead.

An Eric Chavez double tacked on another run in the fourth and back-to-back hits brought a Diamondbacks run across in the fifth.

Lincecum was coming off two strong starts against the San Diego Padres but allowed five earned runs and 10 hits Wednesday.

"I continually put them in that hole and just made it a little tougher," Lincecum said of his teammates. "They fought real hard."

Doubles by Gregor Blanco and Angel Pagan and a triple by Brandon Crawford pushed two runs across in the top of the fifth.

In the sixth, Pence hit a laser over the ledge in center field. It was the longest recorded home run of his major league career.

"That was unbelievable," Belt said. "Sometimes it looks like he's up there with a golf club and he's hitting a golf ball."

Asked about his blast, Pence pointed out that Belt's homer was the bigger one.

Pence drew a walk with one out in the eighth and Blanco walked two batters later. That set the stage for Belt, who crushed a 95 mph fastball into the right-field seats to clinch the Giants' ninth come-from-behind victory in 28 games.

The comeback gene doesn't only show up in the middle of games. The Giants have been swept twice this season. Both times they came right back to sweep their next opponent.

"It's just the mindset of this team," Pence said.

  • Reliever Jeremy Affeldt (strained oblique) reported that he felt fine after throwing inning in an extended spring training game on Wednesday morning.

    "I put as much pressure on it as I possibly could and it held up fine," Affeldt said of his oblique. "There's no soreness there. It was all good."

    Affeldt will likely be activated Friday when the Giants begin a three-game series against the Los Angeles Dodgers at AT&T Park.

    The Giants are still carrying three catchers and could send Hector Sanchez or Guillermo Quiroz back to Triple-A Fresno to clear a bullpen logjam.

  • Sergio Romo was hit by a throw while covering first base in the ninth inning but waived off trainer Dave Groeschner. Romo picked up his third save of the series and 11th of the season, three shy of his career-high.

  • Paul Goldschmidt entered the night with eight hits in 14 career at-bats against Lincecum, five of which were home runs. But the slugging first baseman was just 1 for 3 with Lincecum on the mound Wednesday and hit into a big double play in the first inning.

  • Pagan hit a leadoff home run and reached base three times.

  • George Kontos pitched 12/3 strong innings out of the bullpen to earn his second win of the season.

  • The three-game sweep was the Giants' first at Chase Field since July 2010.