SAN FRANCISCO -- The best game of Chris Stratton's career got off to a shaky start when the San Francisco pitcher allowed hits to his first two batters and fell behind in the count 3-0 to the third.
A deep breath, a little faith in catcher Nick Hundley and a fastball that was effective all night settled things down.
"It was huge," Stratton said about working out of the early jam. "Hundo did an awesome job back there mixing it up, and once we got past that it really just kind of took off from there."
Arizona remained a game up in the NL West over Colorado when the Rockies lost 10-7 to the Los Angeles Angels.
Stratton and Corbin had nearly identical outings, the difference being Duggar's homer in the second.
Stratton (9-7) permitted five hits, struck out six and allowed only two runners past first base. He walked none and retired 17 of his final 18 batters to win for the first time since June 17.
The right-hander, who leads the Giants in wins despite two stints in the minors, gave up back-to-back singles to open the game but pitched out of it. Stratton also gave up a two-out triple to Jon Jay in the fifth but got Eduardo Escobar to fly out.
It was the Giants' 11th shutout this season.
"The first inning, that was the key inning for (Stratton)," San Francisco manager Bruce Bochy said. "After that he was really good. Really good with his command and all of his pitches. We needed it. Their guy threw well."
Corbin (10-5) was equally sharp after yielding Duggar's home run. The Arizona lefty retired the next 10 batters, then got three consecutive groundouts after allowing a double and a single to start off the sixth.
Corbin had nine strikeouts and one walk in seven innings while absorbing his first loss in six starts against the Giants this season. He gave up four hits.
"Usually our offense is going to get us back in it so I just tried to put up as many zeros as I could," Corbin said. "We had a couple chances early tonight but Stratton was a little bit better."
The Diamondbacks became the fastest team in major league history to reach 25,000 strikeouts as a team, topping the milestone in 3,371 games. The Miami Marlins did it in 3,650 games.
"Really unfortunate night for Patrick," Arizona manager Torey Lovullo said. "He threw the ball extremely well. Just made one mistake. Outside of that, he was outstanding. Unfortunately we couldn't score some runs for him."
Duggar's second home run of the season helped the Giants gain ground on the Diamondbacks. San Francisco pulled within seven games of first place and 7 1/2 of the second wild card.
"If we can keep rallying off some wins, we might surprise some people," Duggar said.
Jon Jay had three hits for Arizona. Paul Goldschmidt walked in the ninth and has reached base safely in 39 consecutive road games, an ongoing club record.
Duggar lined a 3-1 pitch from Corbin to right field, two batters after Brandon Crawford singled. Duggar's only other home run this season also came against Arizona on Aug. 4.
CORBIN'S STREAK ENDS
Corbin had not allowed a home run in 11 consecutive starts before Duggar's drive. That matched the longest streak by a Diamondbacks pitcher, equaling the mark set by Miguel Batista from August 2002 to April 2003.
"I've probably made worse pitches than that that weren't for homers," Corbin said.
Giants catcher Buster Posey underwent successful hip surgery in Vail, Colorado. The six-time All-Star will be sidelined six to eight months.
RHP Clay Buchholz (7-2, 2.25 ERA) opposes San Francisco LHP Madison Bumgarner (5-5, 2.88) in a marquee pitching matchup Tuesday night. Buchholz is 2-0 and has allowed one run over his past two starts covering 16 innings. Bumgarner has yielded three runs or fewer in 12 of his 15 starts.
More AP MLB:�https://apnews.com/tag/MLB and�https://twitter.com/AP-Sports
How baseball shaped the career of Patrick Mahomes
Chiefs QB Patrick Mahomes and former MLB superstar Alex Rodriguez each tell the story of their relationship and how Mahomes came to choose football.
Former MLB pitcher John Wetteland arrested on child sexual abuse charge
John Wetteland, who pitched for four teams over 12 major league seasons, has been arrested on a charge of sexual abuse of a child under the age of 14, according to police records.
Five teams ready to strike once Bryce and Manny sign elsewhere
There's more to the market than Bryce Harper and Manny Machado. These clubs could make major upgrades without landing the two biggest prizes.
'I think about his smile, his laugh': Roger Clemens reflects on Mel Stottlemyre
The late great Yankees pitcher and coach battled cancer for decades, but never let on that he was sick.
Schefter: Murray will go in 1st round
Adam Schefter joins SportsCenter to analyze Kyler Murray's decision to declare for the NFL draft.
Kyler Murray declares for 2019 NFL draft: Answering questions about what's next
Murray has declared for the NFL draft. Can he still play baseball? What are the key dates to pay attention to? Here's what you need to know.