It took a little more than five hours, but the San Francisco Giants managed to hold off elimination for at least one night.

Joe Panik’s double off the right field wall in the bottom of the 13th scored Brandon Crawford, who had doubled to lead off the inning, to give the Giants a 6-5 win over the Chicago Cubs in a game that saw both teams rally late to force extra innings.

The Cubs, who won the first two games of the National League Division Series in Chicago, led 3-0 thanks to a three-run home run in the second from starting pitcher Jake Arrieta coming off Madison Bumgarner. Bumgarner lasted only five innings, while Arrieta was out after six while giving up single runs in the third and fifth.

It stayed that way until the eighth when, after the Cubs turned to closer Aroldis Chapman for a six-out save, Conor Gillaspie sparked a three-run inning with a two-run triple to go up 5-3.

The Cubs tied it in the ninth on Kris Bryant’s two-run homer off SF closer Sergio Romo, then it was a scoreless battle until the 13th.

Game 4 is set for 8:30 p.m. ET in San Francisco, with Matt Moore going for the Giants against Chicago’s Jon Lackey.

Scroll down for all of our real-time updates, statistics, analysis, pictures, tweets and anything else worth noting from San Francisco.

 

Follow Brian J. Pedersen on Twitter at @realBJP.

Read more MLB news on BleacherReport.com