Cardinals 9
Nationals 7

WASHINGTON — Doesn’t matter how bad things look for the St. Louis Cardinals. Trailing by a bunch, down to their last strike, they simply stay calm and do what it takes to win.

Erasing an early six-run hole in Game 5 slowly but surely, the defending World Series champion Cardinals got a tying two-out, two-run single from Daniel Descalso and a go-ahead two-run single from Pete Kozma in the ninth inning and came all the way back to beat the Washington Nationals, 9-7, Friday night and win their NL division series.

Advertisement - Continue Reading Below

It was the largest comeback ever in a winner-take-all postseason game, according to STATS LLC. No other club in this sort of ultimate pressure situation had come back from more than four down.

‘‘We knew we had a lot of game left after they scored six. Nobody went up there trying to hit a six-run homer,’’ said Descalso, whose solo shot in the eighth made it 6-5. ‘‘We needed to scratch and claw and get ourselves back in the game.’’

They did, barely; Descalso’s saving single ticked off the glove of diving shortstop Ian Desmond.

First-year manager Mike Matheny and the wild-card Cardinals, the last team to clinch a playoff spot this year, will open the NL championship series at San Francisco on Sunday.

The Nationals, meanwhile, led the majors with 98 wins in 2012 but lost without All-Star ace Stephen Strasburg. The team said he'd thrown enough this year and didn’t put him on the playoff roster.

Down 7-5 with two outs in the ninth against Nationals closer Drew Storen, the Cardinals twice were a strike away from losing. But Storen walked both of those batters, Yadier Molina and David Freese, setting the stage for the unheralded Descalso and Kozma — Nationals manager Davey Johnson even called the rookie ‘‘Cosmos’’ before Game 4 — to come through.

When Cardinals closer Jason Motte got Ryan Zimmerman to pop out to second base a half-hour past midnight, the Cardinals streamed from the visiting dugout for a rather muted celebration, all in all.

This was nothing new to them.

Over the past two years, St. Louis is 6-0 when facing elimination, including victories in Games 6 and 7 of the 2011 World Series against Texas.

‘‘It’s just the kind of people they are. They believe in themselves. They believe in each other,’’ Matheny said.

And to think: Washington, which won the NL East and led the majors with 98 wins, got off to as good a start as possible.

Seven pitches, three runs. Just like that, Jayson Werth’s double, Bryce Harper’s triple and Zimmerman’s homer got the hosts jump-started in their first Game 5.

That opening outburst, plus a big third inning highlighted by the 19-year-old Harper’s homer, made it 6-0.

The Cardinals chipped away. One run off 21-game winner Gio Gonzalez in the fourth, a pair in the fifth, another in the seventh off Edwin Jackson — the Game 3 starter and loser, and an all-around surprising choice for midgame relief.

Suddenly, it was 6-4. Then came Descalso’s homer in the eighth to make it 6-5. After Kurt Suzuki drove in a run for Washington get the lead back up to 7-5, a four-run ninth against Storen completed the reversal.