SAN FRANCISCO — This place does not rattle easily, for this town and this team have felt the rumble of the Earth beneath their feet before. But Tuesday night was different, for this time, the fans squirming in their seats here could see the seismic shift coming.

Three strikes make an out, three outs make an inning, and in October, the Giants find a way to win when the Cubs find a way to lose. These were universal truths, all of them, until the ninth inning Tuesday night turned the world upside down.

When the shaking stopped, the stunning implosion of the Giants bullpen complete, the Cubs emerged with more than a 6-5 victory to win the National League Division Series in four games. No, this was much bigger.

“It’s a validation,” manager Joe Maddon said after watching his Cubs rally for four runs in the ninth. “It’s everything that we believed they are, we are. We come to play every night, man.”

Chasing their first World Series title since 1908, the Cubs secured the first real evidence that they will not be burdened by 107 years of championship futility. They have the will to write their new history, proving as much when Willson Contreras tied it ahead of Javier Baez, who won it.

“We stared down an incredible team, with their pedigree, in their ballpark,” said a soaked Theo Epstein, the architect of a 103-win juggernaut that knocked off this era’s gold standard for October survival.

advertisement | advertise on newsday

Epstein, for all of his jubilation, had only minutes before been among those feeling a dread as familiar on the North Side as a can of Old Style. The Cubs had led this series 2-0. But they lost in 13 innings Monday night and stared at a 5-2 deficit in the ninth inning.

Defeat would have shifted the series to Chicago for Game 5, forcing the Cubs to feel the full force of their tortured history at Wrigley Field, where trauma has resided full-time for decades. Johnny Cueto, who had been masterful in Game 1, would have taken the ball for the Giants. Behind him, available in relief, would have been the best postseason pitcher of all time in Madison Bumgarmer.

The Giants had won 10 straight games when facing elimination. After eight brilliant innings from lefthander Matt Moore, who had surrendered just two runs, his team stood just three outs from heading to Chicago with curses and ghosts and history on their side.

“Our numbers aren’t good against Cueto,” said Maddon, who wore a wet suit to shield himself from the chill of beer and champagne. “I didn’t want that.”

Then the plates shifted, the fault lines roared to life, and the Giants bullpen completed its horrendous season by setting its most fiery and spectacular blaze. Five relievers rushed in like harried firemen. Five relievers left defeated, the ashes of their season on their hands.

Baseball videos

All year, they could not be trusted, blowing 30 saves in the regular season. It was the most ever for a team that had reached the playoffs, and the Giants had done so only by sneaking in the side door. They entered the break with the best record in baseball, then tumbled to the wild-card game, where they beat the Mets.

In Game 3 on Monday night, the Giants won in 13 innings despite Sergio Romo blowing a save. He surrendered a game-tying homer in the ninth to Kris Bryant. One night later, with a three-run lead to protect in the ninth, Giants manager Bruce Bochy put the season in the hands of Derek Law.

When Bryant singled, Bochy countered with lefty Javier Lopez, who walked Anthony Rizzo. Romo entered as the third reliever and promptly gave up an RBI double to Ben Zobrist, sending a wave of dread through AT&T Park.

“That felt heavier because of the way they play in elimination games,” Zobrist said of the hit that proved to be the spark.

In came lefty Will Smith to face Contreras, whose two-run single tied the game. Jason Heyward bunted into a fielder’s choice but advanced when Brandon Crawford’s throw went wide.

advertisement | advertise on newsday

That set the stage for Baez, whose game-winning single came against Hunter Strickland. With that, the foundation had cracked and buckled, the Giants left to process one of the worst innings in franchise history.

The Cubs reached the NLCS for the second straight year while the Giants — champs in 2010, 2012 and 2014 — saw their even-year magic fizzle beneath the smoke of a tire fire.

Cubs fans, lingering as hungry seagulls picked at the detritus of a lost season, lingered behind the visiting dugout to serenade their team long after the final out. They waved white flags emblazoned with a blue W, the same that flies at Wrigley Field to inform commuters riding by on the el of a Cubs victory. They sang “Go Cubs Go,” having finally defeated the wizards of October.

Said Epstein: “To see our guys respond to that — and elevate — was special.”