LOS ANGELES — This time of year, walk-off hits are the stuff of legend, once-in-a-lifetime moments of triumph. They inspire grown men to leave their feet and jump for joy. They stun the stoic into tears. But rarely, if ever, do they qualify as mere relief.

But amid the leaping and the hopping and the hugs that followed Chris Taylor’s walk-off homer Wednesday night, that is exactly what settled in over the Los Angeles Dodgers, for whom a loss in the wild-card game would have qualified as an agonizing disappointment.

That swing gave the Dodgers a 3-1 win over the St. Louis Cardinals and broke an innings-long deadlock between a team that was supposed to be here all along and one that appeared here after a stunning September winning streak. The Dodgers will now face the San Francisco Giants in a best-of-five division series beginning Friday night, ensuring that a team considered one of the sport’s best would not be undone by the quirks of the current playoff format.

The Dodgers won 106 games, most ever by a non-division winner — or, put another way, the most wins ever by a team relegated to a one-game wild-card playoff. In last year’s expanded playoff format, or the one that may be coming if MLB and the players’ union agree to it this winter, the Dodgers wouldn’t have seen their whole season subjected to the whims of one October night. But it was, and they survived it.

“I just love the way coming into this game, knowing we had a built-in excuse as far as a one-game playoff elimination game, we were prepared to win a ballgame,” Dodgers Manager Dave Roberts said.

The relief extended to Taylor, too. The 2021 all-star had struggled so much in the season’s second half that he was dropped from the starting lineup against Cardinals right-hander Adam Wainwright on Wednesday night, though Roberts said over and over before the game that the team would need him at some point like they had in years past. Taylor has been a staple of this Dodgers run, the kind of versatile defender and steady offensive producer with which they have lined their lineup for half a decade.

But after making his first All-Star Game this summer, Taylor hit .228 in August and .121 in September, “grinding,” as his manager put it before the game. So he sat Wednesday, waiting his turn, which came when Roberts sent him to left field in the seventh. He made multiple tough catches there before his at-bat in the ninth, which came against hard-throwing Cardinals reliever Alex Reyes — and ensured the Dodgers’ impressive season didn’t melt away on one fluky October evening.

“It felt good to come through,” Taylor said. “Especially after the last couple months, it’s been a grind for me. Obviously, I haven’t been playing the best. To come through in the ninth felt really, really good.”

The Dodgers have made the playoffs for nine straight seasons. They only fell short of the National League Championship Series once in the past six years. That year, 2019, the Washington Nationals beat them in the division series. This year, in need of reinforcements, the Dodgers ceded two promising prospects for two key pieces of that Nationals team, future Hall of Famer Max Scherzer and MVP candidate Trea Turner.

Those two, and particularly Wednesday night’s starter Scherzer, became so central to the fate of the Dodgers (and the trajectory of these playoffs) over the past few months that Scherzer’s old teammate Juan Soto made the trip to Los Angeles to sit behind home plate with their shared agent, Scott Boras. He wore Turner’s No. 7 Nationals jersey and his 2019 World Series ring. Nationals hitting coach Kevin Long joined him in the front row, wearing a Scherzer Nationals jersey to ensure equal representation.

“When you win a World Series, you develop a friendship and bond that’s going to last a lifetime. For those two guys, Soto and K-Long, to be there, that shows you the kind of love that it takes to win a World Series,” Scherzer said.

Their presence was a reminder of how fresh Scherzer’s ties to the Dodgers still are and how much his new team has foisted upon his shoulders in such a short time. After longtime ace Clayton Kershaw’s late-season elbow injury, Scherzer suddenly finds himself as the anchor of a rotation to which he has belonged for mere weeks — and to which astronomical expectations have been attached all year.

The pesky Cardinals entered Wednesday night with far less pressure as a team known for speed, defense, contact and all the things everyone worries slid out of baseball fashion for good. They scored first when second baseman Tommy Edman flipped a Scherzer breaking ball into right field for a leadoff single, stole second, advanced on a deep flyball, then scored when Scherzer bounced a slider in front of catcher Will Smith, who couldn’t block it. Edman scampered home, and the Dodgers trailed immediately. The pressure was on.

The Cardinals continued to put men on against Scherzer, inning after inning. He was never able to establish his secondary pitches, relying predominantly on his fastball and slider to hang in there until his command resurfaced. In his first 11 starts with the Dodgers, Scherzer never walked more than two batters. He walked two in the first two innings Wednesday, as Wainwright held the Dodgers down.

“We didn’t win,” Wainwright said afterward. “But we came in here and made them real nervous.”

After Justin Turner homered to tie the score in the fourth, a hit and a walk gave the Cardinals two men on with no one out in the fifth for the heart of their order, with Scherzer heading toward 100 pitches. Scherzer hadn’t been locked in all night, but he had been making it work — the kind of night on which he pushes through five and hands the ball off, knowing he did what he could. He muscled a fastball by Tyler O’Neill for the first out. Then Roberts walked to the mound.

Managers who try to take Scherzer out of games before he is ready have most often been greeted with a high-decibel retort. Matt Williams, Dusty Baker and others have headed out only to turn right around and say later they just wanted to hear Scherzer say he still had something left. Scherzer admitted later he was “pitching on pins and needles.”

Roberts said later he had seen Scherzer getting fewer swings and misses than usual, saw his slider backing up — not biting off the plate but sitting on it. He needed a groundball, and he couldn’t take the risk.

Scherzer couldn’t even look at Roberts, who reached for the ball only to find Scherzer shaking his hand instead, trying to stave off the inevitable. Roberts had to pull the ball out of his glove because Scherzer wouldn’t hand it to him.

“I’ll never expect him to be happy,” Roberts said. “But that was my call.”

Reliever Joe Kelly induced that weak groundball and struck out Dylan Carlson to end the inning, ensuring the score remained tied. The Dodgers’ bullpen allowed just two more hits all night, so the teams remained deadlocked in one of those games that would probably be won by whoever batted last — if it was to be won by anyone at all. Scherzer said later he turned to Kelly in the dugout and predicted that Taylor would end it with a homer.

“I had that vision for him. I’ve played with him and faced him and seeing all this, I was like, this is the right man for the right spot. He’s going to put a good swing on it,” Scherzer said. “Sure enough, he did.”

The Dodgers were that team because they had the better record, the only reward they got for winning 106 games in the regular season. Taylor made it reward enough.

— Chelsea Janes

This story has been updated. Find updates and analysis by Jesse Dougherty in Washington below.

10:37 p.m.
Headshot of Jesse Dougherty
Jesse Dougherty: With two outs in the top of the sixth inning, Cardinals Manager Mike Shildt made the critical decision of letting starter Adam Wainwright hit for himself. Reliever Alex Reyes was warming in the bullpen. Harrison Bader had just been hit by Brusdar Graterol to reach with two outs. A half inning before, Dodgers Manager Dave Roberts hooked Max Scherzer at 94 pitches, even though Scherzer had just notched a strikeout with two and one out. Schildt, then, showed the contrast of two approaches to navigating a do-or-die game. Wainwright was at 83 pitches when he stepped into the box and subsequently grounded out. That gave Shildt a window to push him a bit deeper.
Jesse Dougherty, Reporter covering the Washington Nationals.
9:43 p.m.
Headshot of Jesse Dougherty
Jesse Dougherty: Harrison Bader’s nine-pitch at-bat in the fourth was important in two ways: It turned over the lineup, meaning that Adam Wainwright, the pitcher, would end the inning instead of leading off the next. And it also kept adding to Scherzer’s pitch count, which is at 78 through four frames. The Dodgers will almost certainly have to call their bullpen sooner than they’d like to. Bader, the Cardinals’ center fielder, gave a lift to his team’s effort — and the rest of its lineup — by fouling off a 3-2 fastball, then a 3-2 slider, before Scherzer plunked him with an inside curve.
Jesse Dougherty, Reporter covering the Washington Nationals.
9:23 p.m.
Headshot of Jesse Dougherty
Jesse Dougherty: Cardinals shortstop Edmundo Sosa hasn’t had the best defensive night. In the first inning, he got his glove on a ripped grounder from Mookie Betts and let it trickle into shallow left. In the third, Betts poked a liner behind shortstop and Sosa got glove on it again, though it fell to the grass. Sosa is in the lineup because his bat is better than Paul DeJong, who entered the year as the surefire starter. But Sosa’s inability to make 50/50 plays has slowed Wainwright’s rhythm in the early inning — if only because it has forced him to throw more pitches than needed.
Jesse Dougherty, Reporter covering the Washington Nationals.
9:00 p.m.
Headshot of Jesse Dougherty
Jesse Dougherty: The Cardinals entered the postseason with the league’s best defense. Early on, with no outs in the second, Tommy Edman showed why. On catcher Will Smith’s grounder up the middle, Edman, playing second, slid for the ball and threw to first in one fluid motion. Paul Goldschmidt, St. Louis’s first baseman, made a long stretch behind the bag to catch Edman’s throw, a step before Smith reached the bag. The play kept a leadoff runner off base for Adam Wainwright. It also was an on-the-nose illustration of a club that led the majors in outs above average, a catch-all defensive statistic, in 2021.
Jesse Dougherty, Reporter covering the Washington Nationals.
8:30 p.m.
Headshot of Jesse Dougherty
Jesse Dougherty: To strike first, Cardinals leadoff man Tommy Edman sprinted home on a wild pitch for Max Scherzer. And while some pitchers do spike breaking balls when ahead in the count — a tactic to get batters to swing at something they can’t possibly hit — Scherzer is rarely one of them. The closest he’ll get to doing that is throwing back-foot sliders or cutters to left-handed hitters. In this case, up 0-2 against the right-handed Nolan Arenado, catcher Will Smith set a low target and Scherzer bounced a slider way low and wide of the zone. Smith, a catcher who does not go to one knee with a runner on third, couldn’t slide in front in time, permitting Edman to score. The damage was a 1-0 deficit for the Dodgers just four batters into the game.
Jesse Dougherty, Reporter covering the Washington Nationals.