– The third hit batter got the Cardinals mad at the Cubs.

They fell just short of getting even.

Jorge Soler and Kris Bryant hit back-to-back homers, and tempers flared for the second game in a row as Chicago held on to beat St. Louis 5-4 on Saturday to tighten the NL Central race.

Chicago, which has won five games in a row is five games behind first-place St. Louis, which got a two-run homer from Matt Carpenter in the ninth. The Cubs entered the day one game behind Pittsburgh for the top NL wild-card spot.

The Cardinals' magic number to clinch a fifth consecutive postseason berth remained at one.

After Cubs closer Hector Rondon plunked pinch hitter Greg Garcia to lead off the ninth with Chicago leading 5-1, both he and manager Joe Maddon were ejected.

"Obviously, we're not trying to do that right there," Maddon said.

Rondon hitting Garcia nearly sparked a St. Louis comeback.

Carpenter homered off Zac Rosscup to cut it to 5-3. Tommy Pham and Jason Heyward followed with singles, but Pedro Strop got the final three outs — including a sac fly by Yadier Molina that trimmed it to 5-4 — for his third save.

"It was a very intense game," Carpenter said. "But you know what? Every game from here on out is going be an intense game."

Shortstop Addison Russell ended it by diving up the middle to grab Stephen Piscotty's grounder and flipped to second to force out Heyward.

After St. Louis' Kolten Wong was hit for a second time in the eighth, umpire Bruce Dreckman issued a warning. "Every loss stings — I get it —there's plenty of drama and it's out there," manager Mike Matheny said. "Something really good almost happened today. That would have been maybe my favorite win ever."