Anthony Rizzo hit a pair of home runs and Lester pitched eight dominant innings as the Chicago Cubs beat the St. Louis Cardinals 7-0 on Wednesday to clinch at least a wild-card playoff berth.

The Cubs improved their MLB-best record to 93-52 and their magic number is one to clinch their first National League Central title since 2008. Chicago secured a playoff berth because St. Louis and San Francisco are the only teams that could catch them in the standings, but since those teams open a four-game series on Thursday both teams wouldn’t be able to do so.

“I’ll tell you, if you were in that dugout at the beginning of the game, the guys were dead on their feet,” Cubs manager Joe Maddon said. “To play the kind of game we did today — really hot, last game of a long road trip — I give them a ton of credit. (Lester) really played into all that.”

The Cardinals began the day a half-game behind the New York Mets and a full game behind the Giants for one of the two wild-card spots.

Lester (17-4) allowed four base runners, none of which got past first. Cubs catcher David Ross threw out two Cardinals trying to steal second and Lester faced just two batters over the minimum.

Cardinals outfielder Brandon Moss called Lester one of the best in the game.

“Today was one of those days were he had both working and he wasn’t missing over the middle and he was even throwing some curveballs and change-ups to keep you off of everything,” Moss said.

Lester improved to 7-0 with a 1.02 ERA in his last nine starts. He also helped his cause at the plate with an RBI single in the third.

“I’m just trying to give a good at-bat,” Lester said. “He elevated a changeup for me and I got it far enough out there to give us a run.”

Rizzo’s two-run homer in the ninth gave him 31 homers and 101 RBIs on the season. He is the second Cubs left-handed hitter in franchise history to post multiple 30 home run and 100 RBI seasons (Billy Williams did it in 1965, 1970 and 1972).

“Billy Williams, his numbers speak for himself and he’s done it so many years, so it’s a really good feeling,” Rizzo said.

Ross’ two-run homer in the fifth snapped a 0-for-8 streak and it was his first home run since Aug. 17.

St. Louis starter Carlos Martinez (14-8) gave up four runs and eight hits in six innings.

Martinez started off strong, striking out the side in the first and four of the first six batters he faced. Five of his nine strikeouts came on called third strikes. He entered the game having allowed just 12 homers this season and his home run per nine innings average of 0.63 was second in the National League to the Mets’ Noah Syndergaard (0.52).

Ross’ home run was just third by a right-handed batter against Martinez, who had his four winning decisions streak snapped.

The loss dropped the Cardinals’ home record to 33-41, assuring St. Louis of its first losing record at home since 1999 when it played in Busch Stadium II.

While clinching at least a wild card spot is nice, the Cubs look forward to wrapping up the division at home this weekend, preferably tomorrow.

“Let’s do it,” Maddon said. “The sooner, the better. Then we can make our appropriate plans going forward and really set things up to make our best push.”