Jeimer Candelario also hit a two-run homer for one of his two hits and Luis Garcia added two RBIs as the Nationals topped Chicago for a fourth straight time this season
MacKenzie Gore (5-7) allowed five runs, six hits and two walks while striking out six over 6 1/3 innings as Washington improved to 23-24 on the road despite sitting last in the National League East.
Two of the hits Gore allowed were two-run homers by Ian Happ and Patrick Wisdom, but Chicago dropped to 1-3 since the All-Star break and fell for the ninth time in its past 11 home games.
Cubs starter Drew Smyly (7-7) yielded five runs and eight hits while fanning seven and walking one in six innings
Washington took advantage of some first-inning ineffectiveness from Smyly. The left-hander hit leadoff man CJ Abrams with a pitch, and two batters later, ex-Cub Candelario homered into the left field bleacher basket. The homer was Candelario's 14th of the season.
Chicago picked up a run in the second. Cody Bellinger (two hits) reached on an infield single, went to second on Yan Gomes' walk and scored on Christopher Morel's hit.
Smyly settled down before Ruiz opened the fourth with a walk, went to third on Garrett's first double of the night and scored on Dominic Smith's groundout. Garcia followed with a line-drive RBI single off second baseman Morel's glove for a 4-1 Nationals advantage
Washington added a run in the sixth when center fielder Bellinger lost a fly ball off the bat of Garrett, resulting in another double. Garrett eventually scored on Garcia's fly ball that Bellinger caught.
Gore retired 10 straight Cubs until Seiya Suzuki led off the bottom of the sixth with a single. Happ followed with his first right-handed homer this season, his eighth overall
In the seventh, Ruiz drove a Daniel Palencia pitch into the right field bleachers with a man on for his 11th homer.
Wisdom chased Gore when he went deep with a runner on in the bottom of the seventh, cutting the deficit to 7-5. It was his 16th homer of the year.
Washington's Kyle Finnegan pitched 1 1/3 scoreless innings for his 12th save.
--Field Level Media