Adam Wainwright went all the way on the mound and St. Louis got two-run homers from David Freese and Matt Adams to beat the Pittsburgh Pirates 6-1 Wednesday night, advancing to the NL championship series for the third straight season.

Wainwright scattered eight hits in his second dominant win of the division series, coming through for the Cardinals in a winner-take-all Game 5. St. Louis gets to stay at home to open the NLCS against the well-rested Los Angeles Dodgers on Friday night.

"I wanted it bad. It's probably the most nervous I've ever been," Wainwright said. "I don't get a whole lot of nerves when I pitch. Before I pitched today, I was pretty nervous."

By ending Pittsburgh's storybook season, the Cardinals improved to 8-1 when facing postseason elimination the past three years. They also won Game 5 of the NL division series in Washington last year - even though Wainwright got rocked - and at Philadelphia in 2011.

Freese homered in the second inning off rookie Gerrit Cole, and Adams connected in the eighth against reliever Mark Melancon to make it 5-1. Pete Kozma added an RBI infield single, and Wainwright finished it off by striking out Pedro Alvarez with two on.

"I'm just so fired up for this team and this city right now," Wainwright said. "Cardinal fans were rockin' today and I'm just fired up to be here."

Alvarez became the first major league player with an RBI in his first six postseason games on a fluke hit that caromed off first base in the seventh. But the Pirates, who stopped a record streak of 20 consecutive losing seasons this year, were held to one run in each of the final two games of their first playoff appearance since 1992.

"We were able to take a huge step forward this year in restoring the pride and the passion of the Pittsburgh Pirates' organization," manager Clint Hurdle said, "and rebonding our city with a ball team."

Despite their charming turnaround and a victory over Cincinnati in the NL wild-card game, the Pirates haven't won a postseason series since the 1979 World Series.

Wainwright was helped by three double plays - two when Pirates runners strayed too far on line drives. The right-hander struck out six and walked one in a 107-pitch complete game.

"Every time we turned around, Wainwright got in the way tonight," Hurdle said. "We were able to be - the at-bats were better, the approach got better, but he kept making pitches. The last two games they kept us off the plate."

Sidelined with an arm injury when the Cardinals won the 2011 World Series, Wainwright threw seven innings of three-hit ball to beat Pittsburgh 9-1 in the series opener.

He is 4-0 with a 2.03 ERA and four saves in 15 career postseason games, including six starts. As a rookie closer in 2006, he helped the Cardinals win the World Series.

"It's hard not to think back about what happened in Game 5 last year. I just wanted to prove I could go out there and be a good playoff pitcher," Wainwright said.

The 23-year-old Cole beat the Cardinals with an impressive effort in Game 2. They got to him early this time even though his fastball hit 100 mph in the first inning against Matt Holliday.

Freese made the kid pay for a full-count walk to Jon Jay with two outs in the second, lining a 1-2 pitch into the visitors' bullpen in left.

The Pirates had the bullpen up in the fourth after Yadier Molina's infield hit and a throwing error put runners on second and third. Cole gave up just three hits over five innings, but was lifted for a pinch-hitter in the sixth.

Freese struggled this season to overcome a back injury in spring training and had nine homers and 60 RBIs. But just like teammate Carlos Beltran, he's an October star with seven homers, 29 RBIs and a .325 average in 36 career postseason games.

Adams' power hitting helped the Cardinals overcame a mid-foot sprain to cleanup man Allen Craig in early September and he hammered a first-pitch fastball from Melancon well over the right-field wall for his first RBIs of the series.The Pirates scratched out their lone run on two infield hits and the single by Alvarez that looked to be a harmless inning-ending groundout before it hit the bag.

Freese was a hometown hero in 2011, both the NLCS and World Series MVP. He singlehandedly got the Cardinals to Game 7 of that World Series against Texas with a two-run triple with two outs and two strikes in the ninth and then ended Game 6 with a leadoff homer in the 11th.

"He's a stud. He's a big-time player at big-time moments," Wainwright said. "And that's what we expect of him and that's what he continues to deliver."

The snapshot moment from the title run came when Freese joyously flung his helmet between the legs a few steps from the celebration waiting at the plate.At 23 years, 31 days, Cole was the youngest NL pitcher to start Game 5 of a division series and the fifth-youngest NL pitcher to start a winner-take-all postseason game, according to STATS.

Counting the postseason, Cole didn't allow a homer in six straight starts. That ended when Freese connected for a 2-0 lead in the second.

Starling Marte robbed Matt Carpenter of a hit with a diving catch near the left-field line in the third.Neil Walker drew a one-out walk in the first off Wainwright, who issued just 35 walks in the regular season for third-best in the majors and none in Game 1, but went no farther. Carpenter was perfectly positioned at second base to snare a soft liner by Alvarez, flipping to first for an easy double play.

NOTES: Lou Brock, clad in a red sport coat worn by all the Cardinals' Hall of Famers, bounced the ceremonial first pitch, with pitcher Joe Kelly making a nice scoop. ... Josh Young, in town for the musical Evita, sang the national anthem. ... This was the 24th meeting between the teams this season, with each team winning 12 times.