Cahill (3-11) got one out in the sixth inning before Dee Gordon's double ended the right-hander's no-hit bid and ignited the Dodgers' offense.
"I had success against Gordon pitching inside," Cahill said. "I thought I threw him a good pitch, a sinker away, but he stayed on it real well.
"I felt good the first couple of innings. But then I walked a couple of guys. I was able to get out of it, but I knew eventually it was going to catch up to me. When I walked [Justin] Turner in the fifth. I was pretty upset about that, but I was able to get out of it. The next inning, things just kind of fell apart. That's the thing that's hurt me the most, the big inning. They're in first place for a reason, their hitters take advantage."
Two batters after Gordon's double, the D-backs' 2-0 lead had become a 3-2 hole after Gonzalez's first homer, on a 3-1 sinking fastball that didn't sink enough.
Arizona's season-best 10-game errorless streak also came to an end on two miscues at shortstop, the first by Didi Gregorius and the second by Cliff Pennington, which helped set up Gonzalez's second homer, an opposite-field shot in the seventh off a 2-1 slider thrown by reliever Oliver Perez.
"I think he was looking away, and I threw him a slider away, and left it way up," Perez said.
Kemp followed that homer another homer off Perez, and the next batter, Andre Ethier, was struck by a Perez slider. Plate umpire Scott Barry issued warnings to both teams, which drew the ire of manager Don Mattingly and the Dodgers' dugout. Mattingly and ace Clayton Kershaw (who wasn't playing Sunday) were ejected.
"I was surprised when he [the umpire] came out there," Perez said. "I think maybe it was because they [D-backs and Dodgers] had a big fight last year. I was not throwing at him."
Gibson said: "There's no way. He threw a breaking ball in there. ... There's no intent at all."
Dodgers starter Zack Greinke (14-8) went six innings on the muggy afternoon, allowing two runs on six hits (three by Cody Ross). Greinke struck out four and walked three.
Cahill, who also struck out four, allowed just two hits in 5 2/3 innings, but he walked four in his fourth consecutive start without a victory. During that span, he's walked 17 batters in 19 1/3 innings.
"He missed some barrels earlier with all the movement he had," Gonzalez said, "but even in the last inning, he only gave up three runs, so it wasn't like he gave up a lot. I think, for us, it was more about staying with our game plan.
"I'm looking for the same pitch every pitch from him: fastball middle-in to stay up the middle. He has so much running away from me, so I can't swing at anything that starts away, or it's going to run off. I just looked fastball middle-in against him."
Asked about the D-backs' rough season against the Dodgers, Cahill said: "A win's a win. I feel like we've played them pretty good in the past. It's one of those things. I thought we played them well in the first two games this series but didn't win.
"It's tough. I know it's a rivalry, but we just want to go out and win, whoever we're playing."