PITTSBURGH (AP) Jake Arrieta's streak of winning starts ended Wednesday night in Pittsburgh.
No matter, the Chicago Cubs did what they've done every time Arrieta has pitched over the past six weeks: they won.
Pinch-runner Quintin Berry raced home on Anthony Rizzo's sacrifice fly in the top of the 12th inning, and the Cubs slipped by the Pirates 3-2.
''A bunch of young guys kept playing and eventually got it done,'' Chicago manager Joe Maddon said. ''That to me, in that dugout, that dugout was absolutely electric tonight. It was beautiful.''
Arrieta's bid to become the first 20-game winner in the majors went along smoothly before he wavered in the eighth as Pittsburgh rallied to tie it. Arrieta allowed two runs, one earned, and six hits but received a no-decision after winning eight consecutive starts since Aug. 4.
Not that he cared much after the Cubs drew within three games of the Pirates for the top spot in the NL wild-card race despite an errant throw to first in the sixth that gifted Pittsburgh a run and a jam in the eighth he couldn't quite escape unscathed as the Pirates pulled even.
''I made an inexcusable mental mistake in the sixth inning that could've potentially cost us the game. That's my one takeaway,'' Arrieta said. ''That'll bother me for a while, but I grinded it out.''
Chris Denorfia singled off Vance Worley (4-6) to start the 12th and was replaced by Berry, who advanced to second on a wild pitch and third on Austin Jackson's single. Starling Marte tracked down Rizzo's sinking liner to left field but had no shot at Berry.
Kris Bryant had three hits for Chicago. Hector Rondon (6-4) worked two innings in a game that served as a potential preview of what awaits the two clubs in October.
''I feel comfortable against anybody,'' Arrieta said. ''The team that I'm facing on any given day isn't really something I put a lot of time and effort into. I just try and scout, do my homework as well as I can, then go from there.''
Neil Walker and Marte had two hits apiece for Pittsburgh, which fell four games behind first-place St. Louis in the NL Central.
Arrieta's rise is one of the main reasons the Cubs are closing in on their first playoff berth since 2008. His 19 wins are two more than he managed from 2012-14 combined, when the right-hander struggled with his command and an identity on the mound.
That's not an issue anymore.
The Pirates, trying to avoid playing in a third straight wild-card game, didn't exactly do anything to build much confidence should they face the Cubs in the one-game elimination on Oct. 7. All eight of Pittsburgh's hits were singles, and the Pirates went 0 for 4 with runners in scoring position.
''A hit sandwiched in there would have been nice,'' manager Clint Hurdle said. ''We faced one of the best pitchers in the game and I think we're down 2-0 late and we scratch and tie the game up.''
Chicago appeared to give Arrieta all the offense he would need in the sixth when the Cubs finally got to Pittsburgh starter A.J. Burnett. The 38-year-old matched Arrieta for five scoreless innings in his second start since a six-week stay on the disabled list with a strained right elbow.
Rizzo singled in the sixth and scored on a double by Bryant. The rookie slugger made it 2-0 when he raced home from third on a sacrifice bunt back to the mound by Starlin Castro, who reached safely when reliever Jared Hughes threw wide of first for an error.
Burnett gave up two runs and eight hits in 5 1-3 innings. He walked one and struck out seven to give him 2,495 strikeouts in his 17-year career.
Pittsburgh scored in the sixth when Arrieta threw wide of first on a comebacker by Marte and tied it in the eighth after Maddon decided to keep Arrieta in even with the bases loaded and his pitch count at 116.
Gregory Polanco grounded to second, but rather than go to second for the forceout, Castro hesitated and went to first instead, giving pinch-runner Sean Rodriguez time to cross the plate safely before a double play was completed with several throws.
Cubs: RHP Kyle Hendricks (7-6, 4.08 ERA) starts the series finale. He is 0-1 with a 5.63 ERA in three career starts against the Pirates.
Pirates: Charlie Morton will try to win 10 games for the second time in his career when he makes his 21st start of the season Thursday. Morton (9-7, 4.02) is 6-2 with a 3.00 ERA in 10 games at PNC Park this year.