Skaggs allowed three runs on eight hits in 4 1-3 innings.
Hyun-Jin Ryu wasn't much better.
He gave up a solo homer to Hill in the first inning and a sacrifice fly to him in the third. Given the lead back, Ryu allowed a pair of one-out singles in the fifth and Goldschmidt followed with his two-run double. Martin Prado made it 5-3 with a run-scoring single.
Ryu allowed five runs on seven hits in five innings, the second time in 18 starts he's failed to reach the sixth inning.
Gonzalez led off the seventh inning with his 14th homer off David Hernandez to cut Arizona's lead to 5-4, then set the tying run after fouling off five pitches from Bell, who's allowed nine runs his past 11 outings.
"I feel really bad because I left everybody down," Bell said. "We definitely should have won that game."
Even after Bell's blowup, the Diamondbacks had chances, as did the Dodgers.
But, with fans falling asleep in the stands, Ramirez and Ellis finally put the Dodgers ahead for good, sending them home with an exclamation point to their successful road trip.
"We might be the only team in baseball not looking forward to the All-Star break," Ellis said.
NOTES: Dodgers 2B Skip Schumaker sat out and will not play Thursday after having his two-game suspension upheld by Major League Baseball. He was one of eight people suspended following a bench-clearing brawl against Arizona on June 11. ... The Dodgers' Ricky Nolasco and Greinke, who started the series' first two games, were the first pair of starting pitchers to go at least a combined 5-for-5 at the plate in consecutive games since Cincinnati's Tim Pugh and John Smiley did it May 6-7, 1994, according to information provided to the Dodgers by the Elias Sports Bureau. ... Wade Miley will pitch for Arizona in the opener of a four-game series against Milwaukee on Thursday. The left-hander won for the first time in a month by allowing a run in eight innings against the Rockies on Saturday. ... RHP Yovani Gallardo, who will start against the Diamondbacks, has allowed 15 earned runs over his past three starts.