Bob Nightengale

USA TODAY Sports

SAN FRANCISCO -- The Chicago Cubs have gone through a torturous century of misery, so no one ever told them this winning business would ever be easy.

But, oh, man, after pulling off their most dramatic ninth-inning comeback in their postseason history, the Cubs are going to need a few days just to sooth their nerves, pulling off a zany 6-5 victory over the San Francisco Giants.

The Cubs, scoring four runs in the ninth inning off five Giants’ relievers, are off to their second consecutive NLCS, and eight victories shy of their first World Series title since 1908.

They’ll play again Saturday evening at Wrigley Field in Game 1 against the winner of the Washington Nationals and Los Angeles Dodgers series, and they’ll need every bit of that time just to soothe their nerves.

The Giants, who's run of World Series titles in an even-numbered years comes to an end, had their 10-game winning streak in elimination games end.

The Giants had the game in hand heading into the ninth inning. Matt Moore pitched eight strong innings and allowed just one earned run over two hits before manager Bruce Bochy turned the ball over to the bullpen.

"I would like to think you're going to get three outs there," said Bochy. "We couldn't do it. Because of the job he did, we had all the guys set up, we just couldn't get outs."

In comes Derek Law. Kris Bryant leads off the inning with a single.

In comes Javier Lopez. He walks Anthony Rizzo to put runners at first and second.

Giants' bullpen ends season only way it knows how — with spectacular meltdown

In comes closer Sergio Romo. Ben Zobrist rips an RBI double down the right field line to cut the deficit to 5-3.

In comes Will Smith. Pinch hitter Willson Contreras singles to center field and knots the game at 5-5. Jason Heyward bunts into a force out, but a throwing error by shortstop Brandon Crawford advances Heyward to second base.

In comes Hunter Strickland, the fifth reliever of the inning. Javier Baez singles in the go-ahead run.

Meltdown complete.

David Ross ground into an inning-ending double play.

"We played them tough," said Bochy. "The first game could have gone either way. We couldn't score there. What a job (Johnny) Cueto did. And tonight, it got away from us. But good teams find a way to come back, and they did it."

"With this team, the big thing is we never give up, we never quit," said Cubs pitcher Jon Lester. "We always feel like we have a chance, whether it's the first inning or the ninth inning."

Gallery: Cubs, Giants clash in NLDS