The odds of the Cubs overtaking first-place St. Louis in the NL Central were diminished Sunday, but Chicago's confidence wasn't.

And the Cubs might have dealt the Cardinals a big blow - even in losing.

St. Louis star catcher Yadier Molina suffered a sprained left thumb tagging out Anthony Rizzo on Addison Russell's fly ball in the eighth, the Cubs ran themselves out of late scoring chances and the Cardinals ended Chicago's five-game winning streak and avoided a sweep with a 4-3 win.

The Cardinals moved six games ahead of third-place Chicago in the NL Central. The Pirates beat the Dodgers on Sunday to remain four games behind St. Louis.

Molina said he'll have an MRI on the thumb Monday.

Chicago couldn't quite come back from an early four-run deficit in this one, but the Cubs won four of their final six regular-season games against the Cardinals.

"I could not be more proud of our guys," manager Joe Maddon said. "It's obvious we're playing on the same level as they are right now."

St. Louis became the first team to clinch a postseason berth - its fifth straight - on Saturday when San Francisco lost.

The Cubs are comfortably ahead of the Giants for the final wild-card spot. And if they advance in the postseason, there's a good chance they'll face the Cardinals at some point.

"Obviously, the ultimate goal is through them," Cubs starter Jon Lester (10-11) said.

Right fielder Jason Heyward threw out Rizzo on Russell's no-out, bases-loaded fly for a double play.

Matheny went out to talk to Molina after the play, but Molina remained in the game for the remainder of the half inning before being replaced for pinch-hitter Matt Adams the next inning.

"It hurts (gripping the bat) a little bit," Molina said. "I just couldn't grip it."

"I'm concerned," manager Mike Matheny said. "We're anxious to hear what the doctor is going to report."

The Cubs ran into another out in the ninth. Starlin Castro led off with a single, but pinch-runner Quintin Berry was thrown out trying to steal second by Molina's replacement, Tony Cruz.

Trevor Rosenthal then struck out Jorge Soler and got Kyle Schwarber to ground out for his 46th save in 48 chances.

St. Louis starter Carlos Martinez (14-7) pitched four-hit ball into the seventh and allowed two runs. Rookies Tommy Pham and Stephen Piscotty homered.

In the eighth, the Cubs loaded the bases on a single and two walks, then Cardinals reliever Jonathan Broxton walked in a run. After the double play, Rosenthal struck out Miguel Montero to end the threat.

Martinez retired 11 straight at one point and finished with six strikeouts. His only trouble came in the third, when he walked two then allowed a two-run single to Rizzo.

Lester labored despite entering the game with a string of three solid starts in which he allowed four runs in 21 innings. He allowed four runs in six innings while striking out seven.

"Our guys did a good job of keeping us in the game," Lester said. "(St. Louis) did a good job of getting out of some jams."

Lester was 1 for 2 at the plate. He's 3 for 11 against St. Louis and 0 for 82 against all other teams.

Pham, the game's second hitter, launched a drive down the left field line over the bleachers onto the street. It was his fifth homer of the season and fourth in his last six games. One out later, Piscotty lined a two-run shot to left.

"If I make two better pitches, maybe it's different," Lester said.