Charles LeClaire-USA TODAY Sports

Michael Chavis' walk-off single capped a two-run, ninth-inning rally that gave the Pittsburgh Pirates a 5-4 win over the visiting Cincinnati Reds on Friday night.

Chavis hit the ball right down the left field line to score Kevin Newman with ease.

With Cincinnati up 4-3 entering the bottom of the ninth, Bligh Madris led off with a single against Joel Kuhnel (2-2). After Tucupita Marcano bunted the runner into scoring position, Newman hit a game-tying double to left field.

Ross Detwiler replaced Kuhnel and intentionally walked Bryan Reynolds, then hit Ben Gamel with a pitch to load the bases and set up Chavis' heroics.

The Reds grabbed the lead in the eighth inning on Kyle Farmer's two-out RBI single. Farmer placed the ball into shallow center field to score Jake Fraley.

Wil Crowe (5-7) served up Farmer's go-ahead hit, letting in an inherited runner, but he got the win after tossing 1 1/3 scoreless innings.

Gamel reached base four times, going 3-for-4 before getting plunked in the ninth. Newman, Greg Allen and Madris each had two hits for the Pirates.

Pittsburgh won its second straight game after a six-game losing streak. Cincinnati fell for the eighth time in 10 games.

Pittsburgh, trailing 3-1 going into the seventh, fought back. The Pirates put together four hits and two runs to tie the game. A sacrifice fly from Newman scored Allen from third, and two batters later, Gamel singled hard to right field to score Madris and tie the game.

Reds starting pitcher Graham Ashcraft was solid, pitching 6 2/3 innings. He allowed three runs on nine hits and one walk while striking out eight.

Pirates starter Bryse Wilson was slightly better, throwing seven innings and allowing three runs. He surrendered five hits and no walks while fanning four.

The Reds got the scoring started in the second inning when Nick Senzel hit a two-run homer to left-center field. Teammate TJ Friedl socked a solo shot to right field in the fifth to increase the lead to 3-0.

Pittsburgh scored its first run in the sixth inning, when Newman came home on a wild pitch from Ashcraft.

More must-reads:

TODAY'S BEST
Pacers' Pascal Siakam leads team to Game 6 win vs. Knicks
Watch: Matt Duchene's 2OT winner sends Stars to conference final
Scottie Scheffler shoots improbable 66 after warming up for PGA Championship in a jail cell
Report: Tua Tagovailoa away from Dolphins amid contract chatter
Nuggets star has worrying comment about latest injury
Paul Skenes makes incredible Wrigley Field history in second-career MLB start
Giants rookie CF to undergo season-ending labrum surgery
Yankees' Juan Soto reacts to Hal Steinbrenner contract talk
Late goal sends Panthers to Eastern Conference Finals
Ex-teammate of Shohei Ohtani placed bets with same illegal bookmaker as interpreter 
Former Rams first-round pick retires from NFL after 11 seasons
Insider provides major injury update on Celtics' Kristaps Porzingis
Watch: Bruins strike first in Game 6 with incredible backhand goal
Dodgers make series of moves involving notable players
Hurricanes not expected to re-sign defenseman, center
Maple Leafs tab former Stanley Cup winner as new head coach
NFL insider expands on competition between Steelers QBs Russell Wilson, Justin Fields
NFL sets outrageous prices for Eagles-Packers Brazil game
Broncos 'very unlikely' to bring back former NFL interceptions leader
Greg Olsen offers broadcasting advice to Tom Brady