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
Mikie Mahtook hit a two-run homer in the eighth inning, and the Detroit Tigers beat the Kansas City Royals 5-4 on Saturday night in Victor Martinez's final major league game.
Mikie Mahtook sends it flying to deep left field in the 8th inning to power the Tigers.
In the last at-bat of his career, Victor Martinez goes out on a high note with hit No. 2,153.
Niko Goodrum powers the Tigers early, first with a single to center that plates a run and then scores another with a ground rule double.
Aaron Hicks drives in Didi Gregorius to send the Yankees to a 3-2 win over the Orioles and clinch a wild-card spot.
The Yankees are back in the postseason, though not the way they wanted.