Ryu (11-5) joined Zack Greinke and Clayton Kershaw in making the Dodgers the first team in the majors with three 11-game winners. The left-hander allowed two runs and five hits with a walk and five strikeouts.
"He had a good fastball, a good curveball and he threw his fastball to both sides of the plate," Los Angeles manager Don Mattingly said. "I thought he pitched really well and kept them off balance the whole time."
Justin Turner had two RBIs and scored twice for the Dodgers, who snapped Pittsburgh's six-game home winning streak.
Pirates starter Edinson Volquez (8-7) had won four straight starts, tying his career high.
Los Angeles played without right fielder Yasiel Puig (left hand) and shortstop Hanley Ramirez (left wrist) after both were injured when they were hit by pitches last weekend in St. Louis. Puig and Ramirez had X-rays in Pittsburgh that came back negative Monday.
To compensate for their absence, Mattingly started Matt Kemp in right field -- his first appearance there since 2009 -- and Turner at shortstop. Turner's start was his first since June 28, the day he sustained a strained left hamstring that put him on the disabled list for three weeks.
Turner scored on Kemp's double in the third for the game's first run. The following inning, Turner's sharp liner wasn't handled by Pirates third baseman Josh Harrison and turned into a two-run double.
Gonzalez followed with an RBI single to make it 5-0.
That was plenty for Ryu, who retired 18 of the 20 batters he faced outside of Pittsburgh's two-run fourth inning.
"As a team we did a good job of putting good at-bats together when there were runners in scoring position," Gonzalez said. "We got those five runs in those two innings -- and Ryu on the mound made it enough, for sure."
Volquez won five of his previous six starts and had a 0.90 ERA over 30 innings during his four-start winning streak. But he allowed 10 hits and three walks as the Pirates fell short of their first seven-game home winning streak in five years.
"Everything was off today," said Volquez, who partially blamed the 11-day layoff between starts. "I wasn't executing my breaking balls.
"I'm just battling all the time. Fighting myself to find a rhythm, to execute pitches and stay in the game."
Pittsburgh (52-47) also missed an opportunity to move seven games over .500 for the first time this season.
"We battled and stayed in the game the best we could," manager Clint Hurdle said. "We just couldn't add on after the fourth."
Los Angeles catcher A.J. Ellis was hit in the head with a 78 mph pitch from Volquez in the second inning. The ball bounced off his helmet, and Ellis immediately ran to first and stayed in the game after being briefly examined by a trainer. ... The Dodgers plan to activate RHP Josh Beckett from the disabled list in time to start Tuesday at PNC Park. Beckett has been on the DL since July 8 because of a left hip impingement. RHP Vance Worley will start for the Pirates. ... Pittsburgh RHP Gerrit Cole, on the disabled list since July 9 because of lat soreness, will throw 50-60 pitches in a simulated game Wednesday.