Jon Lester allowed one hit while pitching into the seventh inning, Paul Goldschmidt homered and the St. Louis Cardinals inched closer to the slumping Cincinnati Reds in the NL wild-card race with a 3-1 win Monday night.

The Cardinals closed within 2 1/2 games of Cincinnati for the second wild-card spot. San Diego is in between them.

The Reds have scored one run in each of their last three games — all losses — and have dropped five of their last seven games. Their top four hitters in the lineup combined to finish 0-for-14.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

"We’re a good-hitting team," said Reds shortstop Kyle Farmer, who got Cincinnati's only two hits, including his career-high 12th home run. "Good hitting teams break out of slumps. There’s not much pressing among guys. We’ve faced some really, really good pitching the last five games."

Lester (5-6), in his sixth start for St. Louis since being acquired from Washington on July 30, retired 16 consecutive batters after giving up his only hit, Farmer’s second-inning leadoff homer.

"Obviously, we all know what’s in front us," Lester said. "We have a lot of games against these guys and the (Central-leading) Brewers coming up. To pitch well is a great feeling. To do it against a team that you’re trying to chase down is even better."

The veteran left-hander walked two and struck out five in 6 1/3 innings, earning his fourth straight win after losing his first two starts with the Cardinals.

Right fielder Dylan Carlson, who contributed a sliding catch of Joey Votto's flyball in short right-center field in the fourth, described Lester's work as "awesome."

"He had his game face on, and he had the stuff to match the strong intensity he brought to the game," St. Louis manager Mike Shildt said. "He changed speeds well and had the good curveball in play. He kept then off-balance. He had them a little out front. He was tremendous to get into the seventh."

T.J. McFarland allowed a hit in 1 1/3 innings and Luis Garcia got the last out of the eighth before Giovanny Gallegos pitched the ninth for his third save.

The Cardinals needed just two batters to grab a 2-0 lead. Luis Castillo (7-14) walked Tommy Edman, the reigning NL Player of the Week, to lead off the game. Goldschmidt followed with an opposite-field homer to right, his 22nd of the season and 11th in 41 career games at Great American Ball Park.

"Luis got a little to much of the plate to a good hitter," Reds manager David Bell said. "Other than that, he was outstanding."

St. Louis added a run in the sixth when Carlson doubled and later scored on Tyler O’Neill’s dribbler up the third base line.

Farmer’s homer was his 12th of the season, adding to his single-season career high. He snapped a 0-for-14 slump.

Castillo lasted six innings, giving up five hits and three runs with two walks and eight strikeouts. He has lost four of his last five starts after three straight wins.

SOUVENIR TIME

A young fan leaned over the seat in front of him with his black glove to catch Farmer’s home run on the fly and was rewarded with high-fives from the fans near him.

VOTTO ON VERGE

Votto needs one home run to reach 324 in his career and tie Hall of Famer Frank Robinson for second on Cincinnati’s career homer list. Johnny Bench leads with 389.

TRAINER’S ROOM

Reds: RHP Brad Brach (right shoulder impingement) began a rehab assignment at Triple-A Louisville on Monday. He’s been on the injured list since Aug. 8.

UP NEXT

Cardinals: RHP Miles Mikolas (0-1) is scheduled to make his fourth start of the season and second since returning from his second stint on the injured list (right forearm).

Reds: RHP Sonny Gray (6-6) has strung together a season-high 13 consecutive scoreless innings over his last two starts.