The Cubs clinched a postseason series at home for the first time in team history Tuesday night at Wrigley Field, topping the Cardinals 6-4 to win the National League Division Series 3-1.

The Cubs advance to the National League Championship Series, where they will play the winner of the Mets-Dodgers series, starting with Game 1 on the road Saturday.

Anthony Rizzo hit the go-ahead homer, his second in two games against Cardinals reliever Kevin Siegrist, on an 0-2 pitch in the sixth inning, and Kyle Schwarber added an insurance run with a towering solo shot to the top of the right-field video board in the seventh.

Javier Baez also hit a three-run homer off Cardinals starter John Lackey to help the Cubs to an early 4-2 lead.

With two runners on base and two outs in the second inning, Cubs manager Joe Maddon left starting pitcher Jason Hammel in to hit, and Hammel knocked Lackey’s first pitch up the middle for an RBI single.

Baez, filling in at shortstop for injured starter Addison Russell, then crushed a three-run homer to right field to give the Cubs a 4-2 lead. Entering Tuesday’s game, Baez was 0-for-8 with four strikeouts against Lackey.

Stephen Piscotty wasted no time putting the Cardinals ahead, knocking Hammel’s fourth pitch of the game out into the left-center field for a two-run homer.

Hammel pitched three-plus innings before Maddon lifted him in the fourth after a leadoff walk. Justin Grimm entered in relief, and after a Kris Bryant error put two runners on, struck out Kolten Wong, Tony Cruz and Tommy Pham.

The Cardinals tied the game at 4-4 with two runs off Cubs reliever Trevor Cahill in the sixth, on an RBI double from Tony Cruz and an RBI single from Brandon Moss. Cubs right fielder Jorge Soler threw home to catch Cruz at the plate to prevent him from scoring the go-ahead run.