Tyler Stephenson hit a tiebreaking sacrifice fly in the eighth inning, rallying the Cincinnati Reds to a 6-5 win over the St. Louis Cardinals on Friday night.

Kyle Farmer, who also homered, led off the eighth with a single for his third hit of the game. He was safe at second on a throwing error by Giovanny Gallegos (5-3) on pinch-hitter Tucker Barnhart’s potential double-play ball.

One out later, Jesse Winker walked to load the bases ahead of Stephenson.

"Early in the season I was hitting the ball hard but didn’t have anything to show for it," Farmer said. "Now I’m starting to get some hits."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

"I’m happy for Farm," manager David Bell said. "He had a great night. He’s such a huge part of our team in every way."

Joey Votto also had three hits for the Reds, who shook off long home runs by Paul Goldschmidt and Harrison Bader to maintain their hold on second place in the NL Central.

"I know the situation," Stephenson said. "I don’t try to do too much.I tried to get a pitch up to get in the air. I would have been fine striking out, just so I didn’t hit into a double play. I wanted to give Joey a chance."

St. Louis had won five of its last six games. The win was just Cincinnati’s second in seven games on the nine-game homestand.

Andrew Knizner’s two-run single was one of four straight hits delivered by the bottom of the St. Louis batting order during a sixth-inning three-run rally. that made it 5-3.

"There was no panic in the dugout when we fell behind," Farmer said. "I don’t think anyone looks at the scoreboard, honestly. We just go about out business."

Votto’s third hit and second double helped the Reds tie the game in the seventh. Eugenio Suárez drove in one run with a double down the left-field line. Votto scored the tying run on a wild pitch before Dylan Carlson threw out Suárez trying to score on Aristides Aquino’s fly ball to right.

"A lot of moving parts in that game," St. Louis manager Mike Shildt said. "We had the bases loaded and nobody out and guys on first and second with nobody out and couldn’t cash in."

Right-hander Brad Brach (1-1) pitched a perfect eighth. Right-hander Heath Hembree earned his first save, striking out the side in the ninth, including pinch-hitting pitcher Adam Wainwright for the final out. Wainwright batted because Yadier Molina had a stiff neck.

"Yadier would've batted there," Shildt said.

Goldschmidt launched a booming flyball that sailed five rows deep into the second level in left-center field in the first against Tyler Mahle. Bader hit a line drive that banged off the ribbon board on the façade of the second deck in left field in the second.

Mahle lasted five innings, allowing five hits and two runs with four walks and five strikeouts before being victimized by a second straight blown save. He hasn’t won in six starts since June 16.

Left-hander Wade LeBlanc, still looking for his first Cardinals win in five starts and four relief appearances after signing as a free agent on June 17, allowed eight hits and three runs with a walk and five strikeouts in four innings.

Votto drove in two runs with a double into the right field corner in the first inning. Farmer lined a homer into left in the fourth. A fan dropped his glove on the field trying to make the catch.

STILL CLIMBING

Votto’s two-run double lifted his career RBI total to 1,010, fourth on the Reds’ list, one more than Hall of Famer Frank Robinson. Pete Rose is third with 1,036.

PROUD PAPA

The Reds placed LHP Amir Garrett on the three-day paternity list and recalled from Triple-A Louisville INF Alejo Lopoez and RHP Vladimir Gutierrez.

FURTHER REVIEW

The game was delayed for several minutes in the bottom of the second inning while umpires used replay to determine that Tyler Naquin hadn’t drawn a leadoff walk. Naquin was brought back to the plate and grounded out.

STEALING SIGNS

Winker trotted off the field after the top of the fifth carting a cardboard sign that had fallen out of the stands.

TRAINER’S ROOM

Cardinals: RHP Miles Mikolas (right forearm tightness) is expected to pitch two innings in his first rehab appearance for Triple-A Memphis at Louisville on Saturday. Mikolas has been sidelined since May 23.

Reds: OF Nick Castellanos (right wrist microfracture) was placed on the 10-day injured list, retroactive to Tuesday. … RHP R.J. Alaniz left the game with two runners and a 2-0 count on Bader in the seventh.

UP NEXT

Cardinals: RHP Jake Woodford (2-1) earned his first major league win as a starting pitcher on Monday against the Cubs.

Reds: RHP Luis Castillo (3-10) is 1-2 with an 8.16 ERA in three starts against St. Louis this season.