SAN FRANCISCO -- In retrospect, Brandon McCarthy is thinking maybe he should have saved the game ball.
Despite having pitched half his eight career seasons for western teams, McCarthy posted just his first road win in California on Saturday night, limiting the San Francisco Giants to six hits in eight innings in the Arizona Diamondbacks' 2-1 victory at AT&T Park.
"Maybe I broke through here," the 30-year-old said with a chuckle after taking a moment to ponder the accomplishment. "I don't know, but it seems like most of those (previous) starts, we were winning."
The eight-year veteran gave up a third-inning run but then shut down the Giants until handing over the ball to Brad Ziegler, who notched his ninth save of the season with a perfect ninth inning.
The win, Arizona's second in three games in San Francisco this week, allowed the Diamondbacks to remain 8 1/2 games behind Cincinnati in the National League wild-card race.
Paul Goldschmidt had three hits, including a fifth-inning RBI triple against Giants starter Matt Cain that broke a 1-1 tie, as the Diamondbacks picked up their major-league-best 31st one-run win of the season.
Pitching for the first time at AT&T Park, McCarthy entered the game never having won on the road against the Giants, A's, Dodgers, Angels or Padres. In stints with the White Sox, Rangers, A's and Diamondbacks, he had been 0-6 with a 6.14 ERA in 11 previous California appearances.
Actually, McCarthy (4-9) had trouble winning anywhere on the road recently. His last victory away from Arizona's Chase Field had been May 18 at Miami, after which he had gone 0-4 with an 11.40 ERA before taking the mound in San Francisco.
"Everything is falling back into place," he said after a third consecutive impressive start. He has doubled his win total over that 13-day stretch.
"It's consistency and location," he said. "For me, if my location isn't on, I'm in trouble."
The second-year Diamondback struck out six and walked one, his 76th consecutive start with three or fewer walks. He also made one of the most important defensive plays of the game.
Clinging to a 2-1 lead in the eighth, McCarthy stumbled back-to-the-plate to catch Angel Pagan's looper behind the mound that appeared destined for a leadoff hit.
"I'm surprised I was needed. I'm used to doing nothing," he said. "I feel I'm athletic. It just doesn't show when I hit."
His teammates greeted his return to the dugout at inning's end with laughter.
"I was getting ridden by our dugout," the 6-foot-7 pitcher said. "Then going to the dugout, I stumbled and kind of turned my ankle. I was just trying not to look like a goofy idiot."
Cain (8-9) was making his return to the mound after having been nailed by a line drive on the right forearm on Aug. 22 against Pittsburgh. He was activated from the disabled list before the game.
Cain returned to his post-All-Star Game form, pitching into the seventh inning for the sixth time in his last seven starts. He was pulled after giving up a one-out walk to Adam Eaton in the seventh, having allowed two runs and eight hits in 6 1/3 innings. He struck out three and walked four.
He walked away happy about everything except the outcome.
"You don't think about (how well you pitched) when it's a close game and McCarthy threw the ball the way that he did," Cain said. "You've got to give him credit. It comes down to whoever is going to make the least amount of mistakes. I made more than he did today."
The Giants' bullpen escaped jams in each of the final two innings, holding the Diamondbacks without a run in the eighth only after shortstop Brandon Crawford threw out Wil Nieves at the plate as he attempted to score on a Gerardo Parra double.
Diamondbacks shortstop Chris Owings, who wrapped up Pacific Coast League Most Valuable Player honors last week, had his first major-league hit with a sixth-inning single against Cain. Owings had been 0-for-6 with a walk since his promotion from Triple-A Reno on Monday.
The 22-year-old prospect added a second single off Giants reliever Heath Hembree in the ninth and had his first stolen base.
The Diamondbacks outhit the Giants 10-6.
Goldschmidt's second and third hits of the night contributed to Arizona's two runs.
After the Giants had scored first on a Marco Scutaro RBI single in the third inning, the Diamondbacks quickly got even on Parra's fourth-inning single that scored Goldschmidt.
The slugging first baseman delivered his 28th career RBI against the Giants in the fifth, booming a triple to the base of the 421-foot marker in right-center field. Eaton raced home from first on the play for a 2-1 lead.
NOTES: Arizona logged its 41st win after trailing at some point in the game, the second-highest figure in the majors. ... Parra tied Kansas City's LF Alex Gordon for the major-league lead in outfield assists with 14, forcing Brandon Belt at second base in the sixth inning after dropping Hunter Pence's flyball. ... Diamondbacks 2B/3B/LF Martin Prado was a late scratch from the starting lineup after informing manager Kirk Gibson he felt ill about an hour before the game. Prado, the reigning NL player of the month, had started 11 consecutive games, hitting safely in nine of them. ... Seeing a pitcher lose a perfect game on the 27th batter -- as Giants RHP Yusmeiro Petit did Friday night -- was nothing new to San Francisco first base coach Roberto Kelly. He denied Toronto RHP Dave Stieb a perfect game with a two-out, ninth-inning single on Aug. 4, 1989.