Ryu (2-1) struck out eight and walked one, retiring 18 of his last 19 batters. The only hits off the South Korean left-hander were a pair of singles by Miguel Montero.
Gonzalez hit a two-run homer off Brandon McCarthy (0-2) in the first, doubled in two more in the third and had an RBI single in the eighth. The Dodgers' Hanley Ramirez was 3 for 4 with two doubles, drove in a run and scored three times.
It was the Dodgers' first visit to Chase Field since clinching the NL West title there last September, when they angered the Diamondbacks by celebrating in the ballpark's swimming pool.
Jamey Wright pitched two hitless innings to complete the shutout, which took just 2 hours, 26 minutes. The Dodgers had not blanked the Diamondbacks in Arizona since July 27, 2003, according to STATS.
Ryu rebounded from a rough outing a week ago against San Francisco, when he was tagged for eight runs - six earned - in two innings.
He beat the Diamondbacks for the second time this season. He was the winning pitcher in the Dodgers' 7-5 victory over Arizona in Australia on March 23.
In another example of the Diamondbacks' starting pitching woes, McCarthy allowed six runs and 10 hits in seven innings.
He retired his first two batters, then Ramirez singled up the middle. That brought up Gonzalez, one of the leaders of last fall's assault on the swimming pool. He hit the first pitch he saw into the right-field seats for his third home run of the season.
The Dodgers got two more in the third. Carl Crawford led off with a single, then after Yasiel Puig grounded into a fielder's choice, Ramirez singled and took second on the throw to third. Gonzalez singled sharply to center to bring both runners home and make it 4-0.
McCarthy settled down after that, retiring 11 in a row before Dee Gordon's one-out single in the seventh. Gordon stole second, took third on Ryu's groundout but was stranded on a nice stop of Crawford's sharp grounder up the middle by shortstop Chris Owings, who threw the runner out at first to end the inning.
Puig doubled leading off the eighth and scored when Ramirez doubled into the left-field corner. Ramirez came home on Gonzalez's single.
Puig was back in the starting lineup after being sidelined by a sprained left thumb, the result of a headfirst slide into first base against San Francisco last Saturday. He missed two games and struck out on three pitches as a pinch hitter against Detroit on Wednesday.
On Friday night, Puig was 1 for 4 and scored twice.
Paul Goldschmidt was 0 for 4 and failed to reach base for the first time in 32 games, ending the fourth-longest streak in Diamondbacks' history.
NOTES: Arizona batters struck out 11 times. ... The Diamondbacks signed 37-year-old LHP Randy Wolf to a minor league contract. He will pitch for Triple-A Reno. ... With Puig back in the lineup, Matt Kemp was the odd man out. He's expected to be back in the lineup against LHP Wade Miley on Wednesday night. ... While Arizona goes with Miley (2-1, 4.05 ERA) on Wednesday, the Dodgers start RHP Zack Greinke (2-0, 3.27). ... Manager Don Mattingly has not announced a starter for Sunday, but the nod is expected to go to RHP Dan Haren.