Crawford was unable to complete what would have been an inning-ending double play and the Nationals escaped with their fourth straight victory.
San Francisco had a 5-4 lead heading into the ninth, but the Nationals got things started against Santiago Casilla (2-4) when Tyler Moore doubled. Stephen Lombardozzi then put down a sacrifice bunt, but Casilla was unable to pick it up and runners wound up on first and third.
Harper followed with a single that drove in Moore with the tying run and Ryan Zimmerman was intentionally walked to load the bases. That strategy temporarily paid off when Michael Morse grounded into a fielder's choice on which Lombardozzi was thrown out at home.
Adam LaRoche was next and he hit a grounder to second baseman Ryan Theriot, who threw to Crawford for the force at second. Crawford bounced his throw to first base and Brandon Belt was unable to field it cleanly as the winning run scored.
Tyler Clippard (2-2) worked the top of the ninth to get the win.