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
Cora can't wait to have Ortiz back
Red Sox manager Alex Cora says, "There's life, there's more important things than the Red Sox," when considering the shooting on David Ortiz.
Kennedy: Our exclusive focus is on Ortiz's health and well-being
Red Sox CEO and president Sam Kennedy discusses the club's arrangements to bring David Ortiz back to Boston after he was shot in the Dominican Republic.
Varitek on Ortiz: He's 'a great human being'
Former Red Sox catcher Jason Varitek becomes emotional talking about David Ortiz and is very complimentary of his former teammate.
Busted lips, blown saves and a whole lotta blame: After rough road trip, Yankees ready to meet the Mets
A hard-fought win Sunday in Cleveland gave the Bombers a reason to celebrate as they come back to the Bronx following a week of drama and tension.
Morton, Rays take on A's newcomer Anderson
Few pitchers, if any, have ever made their first major league start matched up with a guy who has gone unbeaten in his last 20 outings.
Ryu, Dodgers hope to extend hot streaks vs. Angels
Hyun-Jin Ryu is taking the National League by storm this season.