Updated

They piled on Joe Panik at home plate in celebration, and just as has been the case so many times before with everything on the line in October, San Francisco's season was extended another day.

Panik doubled off the wall in right-center field to drive in Brandon Crawford with the winning run in the 13th inning, and the Giants outlasted the Chicago Cubs 6-5 Monday night in Game 3 of their NL Division Series.

Boosted by Conor Gillaspie's go-ahead triple in the eighth off Aroldis Chapman, the Giants rallied from three runs down and won their 10th straight game when facing postseason elimination.

They even overcame Kris Bryant's two-run homer off closer Sergio Romo in the ninth that tied it 5-all — and an early three-run shot by pitcher Jake Arrieta off San Francisco ace Madison Bumgarner.

"Just because we're down, we're not out. If we're breathing, we're still fighting," Panik said.

Panik came through on the 57th pitch from Mike Montgomery, who was working his fifth inning of relief. Crawford hit a leadoff double in the 13th on an 0-2 curveball, bringing Panik to the plate.

The wild-card Giants forced Tuesday night's Game 4 back at their raucous, sold-out ballpark, postponing a potential Cubs clinch party. Chicago leads the best-of-five playoff 2-1 and will send John Lackey to the mound opposite lefty Matt Moore.

"We played it hard, we played it right — and they beat us," Cubs manager Joe Maddon said.

Panik's big hit ended a 5-hour, 4-minute game that was only 29 minutes shy of the total time taken to play the first two series games combined last week at Wrigley Field.

Gillaspie hit a two-run triple in the eighth and Crawford added an RBI single to give the Giants a 5-3 lead.

"There's a sense of calmness," Panik said. "It's like we've been there before."

Rookie left-hander Ty Blach earned the win, escaping a 13th-inning jam when pinch-hitter David Ross bounced into a double play.

Bryant's tying drive hit the top of the left-field fence and bounced into the seats, silencing the orange towel-swirling sellout crowd. The slugger received a warm hug of congratulations in the dugout from Chapman, who had just given up the lead.

On a night when the focus was the marquee pitching matchup between Bumgarner and Arrieta, the bullpens decided this one hours later. Arrieta's three-run drive in the second held up most of the way.

"The game had everything — pitching, timely hitting on both sides. It was just a fun game to be involved with," Giants manager Bruce Bochy said.

Arrieta's shot ended Bumgarner's postseason scoreless streak at 24 innings. The left-hander had also thrown 24 straight shutout innings with the Giants facing postseason elimination, a separate string that was snapped as well.

Buster Posey hit an RBI single for the Giants in the third and Brandon Belt had a sacrifice fly in the fifth. Chapman relieved with two on in the eighth, trying for the second six-out save of his career, and wild-card star Gillaspie tripled to give San Francisco a 4-3 lead.

Crawford added an RBI single, but Bryant's home run off the top of the left-field fence tied the score in the ninth.

Almora made a diving grab in deep right field on Posey's sinking liner in the bottom half and doubled up Belt at first base for an inning-ending double play.

The Giants won the World Series in 2010, '12 and '14, and still believe they can do it again and get by Chicago given their remarkable track record with the season at stake.

In 2012 against the Reds, San Francisco became the first team to come back from an 0-2 deficit and win a best-of-five series with three straight road victories. After that, the Giants came back from 3-1 down to beat the St. Louis Cardinals in the NL Championship Series.

"I just think it's part of our DNA," San Francisco's Brandon Belt said. "We never think we're out of it."

PAGAN SCRATCHED

The only Giants player with strong numbers against Arrieta was a late scratch.

Left fielder Angel Pagan got pulled from the lineup about an hour before the first pitch because of back spasms.

Pagan had a .455 average (5 for 11) against Arrieta with a double and two strikeouts. Gregor Blanco replaced him.

UP NEXT

Lackey will try to pitch the Cubs into their second straight NLCS, while Moore looks to build on his success down the stretch after the Giants acquired him at the Aug. 1 trade deadline from Tampa Bay.