CHICAGO — Within the shoebox of a visitors’ clubhouse at Wrigley Field on Saturday night, tucked away from the joyous ramblings on the jammed concourses, the Giants were awash in the sound of defeat.

Players dressed hastily, the rustling of their belongings being lugged away serving as one of the few distractions from the silence. In hushed tones, catcher Buster Posey stood before his locker and confronted a grim but familiar reality.

“Realistically, we have our work cut out for us,” he said after the Giants lost, 5-2, to the Cubs, who hold a two-games-to-none lead in this best-of-five National League Division Series.

The Giants arrived here as the battle-tested wizards of October, having won championships in 2010, 2012 and 2014. Now they must lean upon their pedigree to preserve their hopes for more World Series glory.

The Giants have won a record nine straight elimination games. But beginning with Game 3 on Monday night, when postseason ace Madison Bumgarner will take the mound, they must run that streak to 12 games to advance to the National League Championship Series.

“You know it can be done,” said Posey, a member of the 2012 team that staved off elimination six times in one postseason.

advertisement | advertise on newsday

The Cubs are one win away from returning to the NLCS for a second consecutive season.

Cubs righthander Kyle Hendricks left in the fourth inning when he was struck on the right forearm by Angel Pagan’s 94-mph liner. But by then, the 103-win Cubs had positioned themselves to take a stranglehold on this series. Giants starter Jeff Samardzija was chased after two brutal innings in which he allowed six hits and spotted the Cubs a 4-0 lead.

Giants manager Bruce Bochy has thrived in the postseason, his decisions rarely inviting scrutiny. But the Cubs made sure that Bochy’s decision to start Samardzija instead of lefthander Matt Moore in Game 2 would become a talking point.

Baseball videos

Samardzija had a 2.45 ERA in his last 10 regular-season starts, showing the best closing kick on the starting staff. Experience also played a factor, Bochy said.

Samardzija spent nearly seven seasons with the Cubs and later declined overtures for a reunion. But when his turn in the order came up in the third, he was pulled for a pinch hitter after throwing only 47 pitches.

In the first, Dexter Fowler ripped a double to right and scored on Ben Zobrist’s single. Matters got even worse for the Giants in the second, when the Cubs pushed across three runs.

Jason Heyward doesn’t hit for extra bases (he slugged .325), Javier Baez doesn’t walk (he drew only 15 this year) and Hendricks doesn’t hit, period (.099 lifetime batting average). But in the second, the Cubs rallied because Heyward doubled, Baez walked and Hendricks fought off a 95-mph fastball, broke his bat and dunked a two-run single into centerfield. Kris Bryant made it 4-0 with an RBI single.

Hendricks, whose 2.13 ERA was the lowest in baseball this season, allowed back-to-back doubles in the third, including pinch hitter Gregor Blanco’s RBI hit. Brandon Belt’s sacrifice fly cut the Cubs’ lead to 4-2.

advertisement | advertise on newsday

The Cubs hoped that Hendricks could assert control from there, using his arsenal of off-speed pitches to keep the Giants off balance. But it was Hendricks who found himself reeling after being struck by Pagan’s liner in the fourth. The ball hit him in his right forearm and then his midsection. He insisted upon staying in the game and threw a few warm-up pitches before being escorted off the mound by a trainer. X-rays were negative, as he emerged with only a bruise.

Even then, the Cubs pressed on. Winning pitcher Travis Wood, who entered in relief, belted a solo shot to become the third Cubs pitcher to homer in a postseason game. He joined Rick Sutcliffe and Kerry Wood.

Hendricks lasted only 3 2⁄3 innings, but five relievers combined to blank the Giants the rest of the way.

Now the Giants find themselves with their backs pressed against the wall. “It’s just compartmentalize as much as you can,” Posey said. “There’s no need to look any further than Monday.”

In 2012, the Giants rallied from a 3-1 deficit in the NLCS to beat the Cardinals. Earlier that October, they overcame a 2-0 deficit against the Reds in the NLDS. It took an error by Scott Rolen in the 10th inning of Game 3 for the Giants’ luck to turn.

advertisement | advertise on newsday

“We caught a break in that Game 3 in Cincinnati,” said Posey, who scored the winning run because of that error. “And hopefully, maybe, we’ll catch another break.”