CHICAGO _ Jason Heyward gave the Cubs' run-thirsty lineup a jolt Wednesday night just before they clinched a National League playoff berth.
But even Heyward's heroics weren't enough as the Cubs' bullpen allowed four runs in the eighth and ninth innings that allowed the Pirates to forge a 6-6 tie.
The Cubs prevailed with a 7-6 win in 10 innings when Albert Almora Jr. hit a single with two out to score pinch-runner Terrance Gore.
The Pirates tied the game in the top of the ninth when Starling Marte hit a two-run double off left-hander Justin Wilson that grazed the glove of first baseman Anthony Rizzo.
It was a tough inning for Rizzo, whose bid to catch a foul pop by Francisco Cervelli was denied by a fan sitting in the front row near the Pirates dugout. Cervelli took advantage of the break by smacking a double that moved Kevin Newman to third, and both runners scored on Marte's hit.
Heyward hit a two-run home run off Ivan Nova with two out in the bottom of the first, and he added an RBI single with two out in the fourth as the Cubs held a 6-1 lead.
The Cubs earned their fourth consecutive playoff berth by virtue of the Cardinals' loss to the Brewers.
But the Cubs, trying to hold off the Brewers for the NL Central title, failed to hold a 6-2 lead after seven innings. Reliever Carl Edwards Jr. walked two batters in the eighth, and Elias Diaz hit a two-run single to cut the Cubs' lead to two.
Heyward, batting cleanup for the fifth time this season, is 8-for-22 against Nova.
The Cubs stretched their lead to 4-1 in the third on a sacrifice fly by Rizzo and a bases-loaded walk by Kyle Schwarber.
The Cubs scored two runs on four consecutive singles after two out in the fourth, capped by Heyward's hit.
The Cubs played without Kris Bryant and Ben Zobrist. Bryant is nursing a left wrist bruise suffered when he got hit by a pitch from Chris Archer on Tuesday. Zobrist is 6-for-38 lifetime (.158) against Ivan Nova.
"(Bryant's wrist is) sore but not as swollen as he thought it was going to be," manager Joe Maddon said before the game. "So he'll be with the trainer (during the game) and come tell me what he's able to do, even if it's to pinch-run. It can be helpful. I'll know more later by walking by him."
Prior to Heyward's homer, the Cubs scored five runs in their last 56 innings covering six games against the Pirates.
Jose Quintana allowed a home run to Jose Osuna in the first and a homer to Corey Dickerson on the first pitch of the fifth.