The Nationals extended their longest winning streak in two years to seven games.
Washington scored three unearned runs thanks to two Baltimore errors and the Orioles also wasted chances throughout the contest.
Baltimore had 18 hits, eight more than the Nationals. The Orioles went 4-for-15 with runners in scoring position and left 12 runners on base. Baltimore has lost five out of six.
Washington scored four times in the fourth and took a 4-2 lead with the help of a throwing error by third baseman Mark Reynolds.
The Orioles tied it in the sixth, but Baltimore struck back in the bottom half of the inning.
Wilson Ramos drew a walk to open the frame off Jeremy Accardo (3-3) and scored on Hairston's double. Hairston went to second on a walk to pitcher Sean Burnett and scored on a single by Jayson Werth. Ian Desmond then lifted a sacrifice fly to bring home Burnett with the third run of the inning.
Burnett (3-3) by recording the final two outs in the sixth.