Gausman (10-5) gave up five hits, walked none and struck out eight. He cruised through the first five innings before running into trouble in the sixth. Asdrúbal Cabrera tagged Gausman for an RBI single, but then the hard-throwing right-hander retired Drew Ellis and Daulton Varsho to end the threat.
It was a much-needed bounce-back outing for the NL All-Star, who had struggled since the midseason break with an 0-2 record and 8.49 ERA in three starts.
Gausman said he made some minor mechanical adjustments during recent bullpen sessions - mostly related to posture - that allowed him to have more success.
"I just felt like it locked everything back in," Gausman said. "I noticed the ball really having the life it had in previous starts."
Arizona starter Zac Gallen (1-6) took the loss, giving up three earned runs over 5 2/3 innings. San Francisco's Donovan Solano gave him the most trouble: He hit a solo homer in the fourth and chased Gallen from the game in the sixth with a two-RBI single.
Gallen gave up four hits and three walks while striking out six. He threw a season-high 109 pitches.
"Pretty decent stuff, they were just taking some good pitches," Gallen said. "They were patient."
The first-place Giants broke the game open in the seventh when Dickerson hit a line drive homer over the right-center field wall off Jake Faria, scoring Buster Posey and Austin Slater. It was Dickerson's 12th homer of the season.
The Giants scored four runs in the seventh off Faria, all with two outs. Faria struck out LaMonte Wade for the third out, but he reached first after the ball bounced away from catcher Bryan Holaday. The next four batters all reached base, including Dickerson's homer.
"The wheels came off a little bit," Arizona manager Torey Lovullo said.
San Francisco's Tommy La Stella reached base four times on two singles and two walks in his first game back from the injured list. It was his first game in more than three months.
La Stella signed a $18.75 million, three-year deal with the Giants during the offseason.
"It's sort of what we were hoping for when we signed him - the kind of game he gave us today," Giants manager Gabe Kapler said.
The Diamondbacks finished with just six hits, including five singles and one double.
Giants: La Stella (hamstring) was reinstated from the 60-day injured list and started at third base ... RHP Anthony DeSclafani was placed on the 10-day injured list with right shoulder fatigue. The move is retroactive to Aug. 3. ... LHP Conner Menez designated for assignment. ... OF Mike Yastrzemski was scratched from the lineup with right hamstring tightness. ... Kapler said 1B Brandon Belt (knee) was expected to arrive in Phoenix on Wednesday and could be added to the active roster as soon as Thursday.
Diamondbacks: IF Josh VanMeter was scratched from the starting lineup because of low back spasms. VanMeter later made a pinch-hit appearance and struck out.
The Giants and D-backs wrap up a four-game series on Thursday afternoon. San Francisco will send LHP Alex Wood (9-3, 3.83 ERA) to the mound to face D-backs RHP Merrill Kelly (7-8, 4.38).
Donovan Solano cranks solo homer vs. D-backs
Donovan Solano gets the Giants' scoring started with a solo home run in the fourth inning.