Jose Osuna added a pair of hits and an RBI for the Pirates. Pittsburgh has won seven of its past nine games and eight of its past 11 as it looks to finish the season above .500 for the first time since 2015.
Chicago starter Cole Hamels led his team at the plate with a solo homer. The Cubs (91-65) entered the game with a magic number of five to clinch the National League Central title over the second-place Milwaukee Brewers.
Pirates starter Jameson Taillon (14-9) limited the Cubs to one run on five hits in seven innings. He walked three and struck out five. It marked his 21st consecutive start in which he allowed three runs or fewer -- the second-longest streak in the majors this season behind New York Mets ace Jacob deGrom (28).
Hamels (9-11 overall, 4-2 with the Cubs) drew the loss after giving up three runs (two earned) in six innings. He walked two and fanned seven.
The Pirates (79-76) opened the scoring in the first when Cervelli belted a two-out, two-run homer down the left field line. The blast marked Cervelli's 12th home run of the season, adding to his career high.
Hamels helped his cause with a leadoff homer to center in the third. He tracked a pitch over the heart of the plate and belted it several rows deep into the bleachers for his second career homer and his first since July 21, 2012.
Pittsburgh made it 3-1 in the sixth. Cervelli reached on an infield single and advanced to second on an errant throw by third baseman Kris Bryant. Two batters later, Jose Osuna doubled to drive in Cervelli.
Kevin Newman drew a leadoff walk in the seventh and came around to score on Reyes' single to increase the Pirates' lead to 4-1.
Reyes capped the scoring in the ninth with his second homer since his Sept. 2 debut.
The season series between the division rivals is tied at eight wins apiece with three meetings remaining.