For Sanchez, it was a night he was rewarded for allowing one unearned run on three hits with five strikeouts in seven innings.
Sanchez (3-3) lowered his ERA to 2.56 after his ninth quality start in 10 starts. Entering the outing, the Marlins were providing the right-hander with just 2.41 runs of support per nine innings, which is why he hadn't won since May 3.
"We scored right on time," manager Ozzie Guillen said of Miaimi's 19th comeback win. "This kid has been pitching so well for us, and we don't help him win some games. Today was a big day. He pitched very good. He's been very consistent all year long. He's been very good for us. Finally, his teammates contributed for him to have a win."
The Marlins moved to within 1 1/2 games of the Nationals in the National League East, and they are 6-3 in their 10-game homestand, which concludes on Wednesday.
"I feel good today. I think the way I always do," Sanchez said. "I try to keep the score down, and just wait for the run support from the team. I know they've got a pretty good team right now, I've got to keep the ball down."
In his career, Sanchez is now 8-0 against Washington.
"I don't know why," Sanchez said. "I face them a lot. I try to pitch like it's every day. I try not to think if Washington is coming here or I'm going to Washington that I've got to win. I don't know who [it helps more], them or me. I know the record is good against that team. But I treat them like any other team. I try to throw strikes, keep the score down and win."
Ramirez opened the eighth with a big home run, estimated at 422 feet.
Heath Bell closed out the ninth, striking out two and picking up his ninth save in 13 chances. After two strikeouts to open the inning, pinch-hitter Jhonatan Solano, brother of Marlins rookie Donovan Solano, doubled in his first MLB at-bat.
The double to right didn't factor into the final score as Xavier Nady lined out to Stanton in right field to seal a series win for Miami.
Ramirez's home run was big, because it added a two-run cushion after the Marlins were able to narrowly preserve the lead in the eighth.
Steve Cishek escaped a bases-loaded, one-out jam in the eighth by striking out Bryce Harper and getting Ryan Zimmerman to bounce to third base.
The Marlins gained the lead in the seventh on Dobbs' pinch-hit sacrifice fly to left. Chris Coghlan set the inning in motion with a one-out single to center. He raced to third on Edwin Jackson's errant pickoff throw.
"The reason why we're winning more games is stuff like that," Coghlan said. "One play doesn't win or lose a game, but there are one, two and sometimes three plays that are just huge. It just so happened that was one of them, and the pickoff and Hanley tacked on another one, so that helped out."
On Dobbs' sacrifice fly to left, Coghlan slid in safely on a close play at the plate. The go-ahead run was unearned.
In the sixth inning, the Marlins pulled even at 1 on doubles by Omar Infante and Stanton.
Stanton's RBI was his 28th of the month, the second most in Marlins history in May. Miguel Cabrera drove in 30 in 2006. Stanton had been tied with Preston Wilson, who had 27 in 2000.
Sanchez held the Nationals without a hit through four innings, limiting Washington to a one-out walk by Carlos Maldonado in the third inning.
But in the fourth inning, Ian Desmond led off with a single through the hole at short. Desmond stole second and moved to third when the throw by catcher John Buck went into center field. Sanchez struck out Rick Ankiel.
With one out, Desmond charged home on the suicide squeeze, and Corey Brown dropped a bunt to the first-base side. The successful squeeze gave the Nationals a 1-0 lead, with the run being unearned.
Sanchez limited the Nationals to one hit through five innings. But so did Jackson.
The Marlins and Nationals have now split their first four games in season, with the series finale set for Wednesday.
"This is one of the better divisions in baseball, if not the best," Desmond said. "It's going to be fun. It's going to be a fun year."