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
Baseball Tonight Minute: Where will Harper & Keuchel land?
Buster Olney breaks down What Dallas Keuchel is looking for in a deal, who Bryce Harper met with this week and the Red Sox's new batting order.
Greg Bird says he's fully healthy as he, Luke Voit compete at first base
As pitchers and catchers begin reporting to the Yankees' spring-training complex this week, an upbeat and self-proclaimed healthier Greg Bird believes he'll soon get back to being the promising player he once was.
Cubs to 'enhance' domestic violence training ahead of Addison Russell's return
The Chicago Cubs are enhancing their domestic violence training ahead of shortstop Addison Russell's return from suspension later this season.
Reliever Sergio Romo, Marlins agree on one-year deal
The Miami Marlins and reliever Sergio Romo have agreed on a one-year deal, a league source tells ESPN.
Could this be the last year for Joe Maddon with the Cubs?
Pedro Gomez looks ahead to the start of the Cubs' season and what they'll need to do to reach the postseason for the fifth straight year.
Yankees' pitcher Masahiro Tanaka no fan of DH, wants to hit and run at National League ballparks
Despite injuring himself last season running the bases, Yankees pitcher Masahiro Tanaka hopes use of the designated hitter does not spread to the National League.