Cole (18-8) allowed one run on four hits while striking out eight and walking just a pair as the Pirates beat the Cubs in a 3-2 pitchers' duel to extend their top wild-card berth spot by another game over Chicago.
"Following the game plan, executing pitches, trying to keep them off balance as much as you can," said Cole, who was still throwing in the mid-90s late in his outing. "I have a little familiarity with these guys so you have to be careful."
Cubs left-hander Jon Lester also worked seven innings and fell to 10-12 with the loss.
The Pirates (94-60) moved 4 1/2 games ahead of the Cubs (89-64) with eight regular-season games to play, while Chicago's magic number to clinch a postseason berth remained at one with nine games left.
Pittsburgh right-handed closer Mark Melancon initially struggled to shut the door in the ninth.
He gave up a double to pinch hitter Chris Denorfia and a run-scoring triple to second baseman Starlin Castro before securing the decision by striking out Jorge Soler and Javier Baez for his major-league-leading 51st save.
"There's no better guy to have on the mound than Melancon with runner on third with one out in that situation," said Pirates manager Clint Hurdle. "He can make pitches. He can carve when he needs to."
"I thought both pitchers were outstanding and both teams played very well," said Cubs manager Joe Maddon. "As a baseball fan you were today entertained."
An announced crowd of 40,432 crowded into Wrigley Field anticipating history as the Cubs sought to clinch their first postseason playoff berth since 2008.
Since then, the Cubs had wandered through five straight losing seasons -- including 101 defeats in 2012 -- plus three managers until Joe Maddon helped right the ship with a collection of veterans and promising young talent.
Cole's third-inning one-out single up the middle scored shortstop Jordy Mercer from second for a 1-0 Pirates lead.
Hitless through the first three innings, the Cubs tied the game 1-1 in the fourth.
Third baseman Kris Bryant collected the Cubs' first hit, a leadoff single. He reached third on first baseman Anthony Rizzo's bloop single to center and scored on shortstop Addison Russell's fielder's choice grounder to short.
Pirates third baseman Aramis Ramirez doubled into the left-field corner leading off the seventh. Ramirez was replaced by pinch runner Keon Broxton, who reached third on catcher Francisco Cervelli's sacrifice bunt and came home for a 2-1 lead on first baseman Michael Morse's base hit to right.
Lester and catcher David Ross were both lifted for pinch hitters in the Cubs seventh. Lester gave up two runs on five hits while striking out six and walking none.
Cole was pulled for a pinch hitter in the eighth as the Pirates put men on first and third on Cubs right-handed reliever Pedro Strop. Mercer, who had reached base on a dropped third strike, scored from third on left fielder Starling Marte's fielder's choice grounder to make it 3-1.
"The get on base by a strike three and that led basically to the winning run right there," Maddon said.
The Cubs had runners on first and second with two outs in the eighth but Rizzo struck out.
NOTES: Thursday's 5-4 victory over Colorado was the Pirates' 10,000th victory in franchise history since joining the National League in 1887. ... LF Starling Marte is just two homers shy of becoming the ninth player in team history with 20 homers and 20 steals in the same season. ... The Pirates are a major-league-leading 36-17 in one-run games, according to the Elisa Sports Bureau. ... Pittsburgh sends LHP Francisco Liriano (11-7, 3.41 ERA) against Cubs RHP Jason Hammel (9-6, 3.79 ERA) on Saturday. ... The Cubs entered the series with nine players with at least 10 homers and 40 RBIs, a franchise record. ... Twenty-game winner Jake Arrieta, scheduled to pitch Sunday, has thrown at least eight innings and allowed no more than one earned run in each of his last five starts. His 1.88 ERA and .191 opponents average are the second-lowest in the majors. ... Major League Baseball has announced that the NL wild-card game will be on Wednesday, Oct. 7, at 8:08 p.m. ET at a site still to be determined. The AL plays on Tuesday, Oct. 6.