Pena, Geovany Soto and Blake DeWitt homered to give Chicago 10 in the four-game sweep, the Cubs’ first in Pittsburgh in 52 years.
The Pirates — in first place in the NL Central 10 days ago — have lost nine of 10 and a season-high seven consecutive.
Pirates starter James McDonald made it through seven innings for the first time this season and had his first three career RBIs during a six-run fourth.
Daniel McCutchen relieved him in the eighth and did not retire any of the three batters he faced. All of them scored.
Trailing 6-4 heading into the eighth, the Cubs’ Reed Johnson and Starlin Castro began with singles. McCutchen (3-3) hit Darwin Barney with a pitch to load the bases. Aramis Ramirez followed with an RBI single off Jason Grilli, and then Joe Beimel walked Pena before Jose Veras finally recorded an out in the eighth — a sacrifice fly by Marlon Byrd.
It was the Cubs’ eighth win this season when they entered the eighth inning trailing. Chicago heads home after completing a 10-game trip in which it lost the first five but won the rest.
Jeff Samardzija (6-4) pitched a scoreless seventh to earn the win, and Carlos Marmol worked a perfect ninth for his fourth save in the past five days and 23rd of the season.
Soto led off the third by homering for the second time in three games and 11th time this season. With nobody on and two outs in the fourth, Pena took the first pitch from McDonald into the shrubbery beyond the wall in straightaway center.
Byrd followed with a single — his 1,000th career hit — and he scored when DeWitt hit a towering shot to right, his third.
Cubs starter Rodrigo Lopez had been given a 5-0 lead in his most recent outing Saturday in St. Louis — but he wasn’t able to get out of the fifth inning and ended up taking the loss. A similar situation appeared to be playing out Thursday, as Lopez was lifted after Pittsburgh’s fourth-inning outburst.
The Pirates hadn’t scored more than six runs in a nine-inning game since July 10 — but they got that many on six hits in the fourth, highlighted by McDonald’s liner into the left-center field gap that cleared the bases and gave Pittsburgh its first lead. Andrew McCutchen followed with a double, scoring McDonald.
Earlier in the inning, Ryan Ludwick’s first hit in 10 at-bats with Pittsburgh drove in the Pirates’ first run. Ludwick later scored on a fielder’s choice by Xavier Paul.
Notes: Andrew McCutchen has reached safely in each of his past 28 games against Chicago and 31 of his past 32 home games overall. ... Pittsburgh RHP Chris Leroux (left calf) began a rehabilitation assignment for Triple-A Indianapolis. ... Ludwick is 11 for 30 (.367) in his career against San Diego’s Aaron Harang, whom Pittsburgh will face to begin a three-game weekend series on Friday. Ludwick is a .301 hitter lifetime against the Padres, who traded him to the Pirates on Sunday. ... Friday Cubs starter Ryan Dempster has won three of his past five starts but has lost his past two decisions against Cincinnati.