Chavis' single to left field against reliever Steve Cishek (0-1) scored Josh VanMeter to put the Pirates in the lead and complete the comeback from down 3-0.
Pittsburgh also came back from three runs down to beat Washington in the first game of the series on Thursday, and have trailed in each of their five wins this season.
''Down one run right there in the (seventh) inning, it would have been so easy, having lost 100 games last year, to just be like, `oh, it's another loss,''' Chavis said. ''But we fought back. We fought back the night before, and I think it says a lot about the guys and the attitude that we have in this clubhouse.''
The Pirates' slow start Sunday was mostly the work of Nationals veteran lefty Patrick Corbin. Corbin had his best start of the season, going 5 1/3 innings with three hits, two runs and four strikeouts after allowing eight runs over 6 2/3 combined innings in his first two starts.
It took until the sixth for Pittsburgh to break through, when Corbin issued a pair of free passes around a Chavis single to load the bases.
''I liked what I saw up until that point,'' manager David Martinez said. ''We've got to get him through that one inning where things just kind of go away for him.''
Victor Arano came on in relief and allowed a Diego Castillo fielder's choice and a Ben Gamel single that each scored a run.
In the seventh, Cole Tucker and VanMeter singled against Cishek. Daniel Vogelbach was intentionally walked and Tucker scored on a wild pitch to tie the game.
Chavis then drove in VanMeter through a drawn-in infield and Vogelbach scored on a Yoshi Tsutsugo fielder's choice to make it a two-run lead.
''The first three innings, we chased a little bit,'' Pirates manger Derek Shelton said. ''As we got later in the game, we started to go to our approach.''
Heath Hembree (1-0) pitched 1 1/3 innings of scoreless relief to earn the win. David Bednar picked up his first save of the season.
The Nationals took the lead with a four-hit second inning. Victor Robles , who had started the season 0 for 18, broke out of his slump with a single to left field off Pirates starter Jose Quintana that scored Lane Thomas and Alcides Escobar. Riley Adams also had an RBI single in the second.
Quintana allowed three runs and five hits in four-plus innings. He walked two and struck out three.
The Pirates did not play the starting left side of their infield, with Ke'Bryan Hayes given the day off and Kevin Newman scratched, but their replacements came up with big defensive plays.
?Chavis snared a Cesar Hernandez line drive that was tailing toward the third base bag with two men on in the second, likely saving multiple runs.
In the seventh, shortstop Diego Castillo made a perfect relay throw from left field Ben Gamel to catcher Roberto Perez to get Josh Bell out at the plate after a Maikel Franco double.
Nationals: OF Dee Strange-Gordon (illness) returned to Washington ahead of the team.
Pirates: Perez returned to the lineup after missing one game and part of another with a bruised left quad. ... Newman (groin) missed his third game, but is expected to return on Monday. ... RHP Luis Oviedo (right ankle sprain) had his rehab assignment transferred to Double-A Altoona and pitched
one-third of an inning.
Nationals: RHP Josiah Gray (1-1, 4.00 ERA) will face the Diamondbacks on Monday to start a 10-game home stand.
Pirates: RHP Zach Thompson (0-0, 4.50) will start a three-game series at Milwaukee on Monday.
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.