ST. LOUIS — Jeremy Hazelbaker knew what he wanted to do in the ninth inning — break up Kyle Hendricks’ no-hit bid.

He delivered. Hazelbaker hit a leadoff homer for the St. Louis Cardinals’ only run Monday night in a 4-1 loss to the Chicago Cubs.

Hazelbaker drove an 0-2 pitch into the right-field stands for his 12th home run of the season. Before that, he was 1 for 25 (.040) with an 0-2 count.

“You just want to break it up. That’s kind of what you want to do, but at the same time you don’t go up to the plate thinking the guy’s got a no-hitter,” Hazelbaker said. “I wanted to put an end to it.”

Even though they lost, the Cardinals remained a half-game behind the Mets for the second NL wild card. New York was routed 8-1 at Washington.

Ben Zobrist and Dexter Fowler homered for the Cubs, who lowered their magic number to three for clinching the NL Central. They lead the second-place Cardinals by 17 games and can wrap up the division with a three-game sweep in St. Louis.

Hendricks (15-7) is the major league ERA leader at 2.03. He threw 96 pitches, striking out seven and walking two.

“If you’re going to give it up, at least it’s that way and not a cheap hit,” the right-hander said. “I just left the ball up and he got it. It was just a changeup and I wanted to throw it in the dirt and get him to chase.”

St. Louis manager Mike Matheny was glad to see Hazelbaker get a hit.

“Obviously, Jeremy coming through there is something positive in the right direction,” Matheny said. “It’s always good to score. We wanted to get something going.

“It’s tough to get the offense going when a guy like Hendricks is pitching like he did tonight. I think that would be safe to say.”

Soon after Hazelbaker’s shot cleared the fence, teammates went to the mound to talk to Hendricks — leading to an animated argument between Cubs manager Joe Maddon and plate umpire Joe West.

Maddon was ejected for the third time this season, and Aroldis Chapman entered to finish the one-hitter. He got three outs for his 14th save with Chicago, and is 34 for 37 overall this year with the Cubs and Yankees.

Maddon thought Hendricks did a good job holding down the St. Louis hitters.

“That’s a good lineup over there,” he said. “They’ve got professional hitters. They hit a lot of home runs.”

The Cardinals lead the NL with 205 homers, four of which have come off Hendricks.

Mike Leake (9-10) pitched six innings before being lifted for a pinch hitter. Leake, making his second start since a stint on the disabled list due to shingles, allowed six hits and four runs (three earned).

“It’s fun to watch, unfortunately,” Leake said about Hendricks’ performance. “He’s turned himself into a guy that’s fun to watch.”

The Cubs took a 1-0 lead on a leadoff homer by Zobrist, his 15th, in the second. Chicago added a run in the third on an RBI single by Anthony Rizzo.

Chicago made it 4-0 in the fifth. Javier Baez reached on a throwing error by shortstop Jedd Gyorko and scored when Fowler hit a one-out homer to right field.

NOT AGAIN

The last time the Cubs won a division title was 2008. They did it by beating St. Louis on Sept. 20 at Wrigley Field.

TRAINER’S ROOM

Cardinals: RHP Michael Wacha (right shoulder) threw batting practice to Brayan Pena, Jose Martinez and Alberto Rosario. Wacha said he hopes to come off the disabled list Wednesday. … LF Matt Holliday took batting practice on the field for the first time since breaking his right thumb Aug. 11 against the Cubs. … Cardinals closer Seung Hwan Oh, who has 17 saves and a 1.87 ERA, was unavailable Saturday and Sunday against Milwaukee because of a sore groin. Speaking through translator Eugene Koo, the reliever said he would not be available Monday but should be Tuesday.

UP NEXT

Cardinals: LHP Jaime Garcia (10-12, 4.58 ERA) makes his 29th start of the season Tuesday night, his most since 2011 when he made 32. He has started seven games against the Cubs and is 3-2 with a 2.27 ERA.

Cubs: RHP Jason Hammel (14-8, 3.50) allowed nine runs — eight earned — and a career-high 13 hits over 5 2/3 innings in a 12-5 loss at Milwaukee last time out. He is 4-4 with a 4.80 ERA in 10 starts against the Cardinals.