PITTSBURGH (AP) Pinch-runner Quintin Berry raced home on Anthony Rizzo's sacrifice fly in the top of the 12th inning, and the Chicago Cubs slipped by the Pittsburgh Pirates 3-2 on Wednesday night.

Chicago starter Jake 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 failed to pick up a win for the first time since Aug. 4.

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.

More from FoxSports

Hector Rondon (6-4) worked two innings as Chicago pulled within three games of the Pirates for the top spot in the NL wild-card race.