The Nationals have won two in a row on the heels of a five-game losing streak that equaled their longest of the season.
Washington needs three more victories to ensure its first winning season since moving from Montreal in 2005.
Harper hit two home runs in Washington's win over St. Louis on Wednesday and then suffered the first ejection of his rookie campaign when he slammed his helmet to the ground in frustration after grounding into a double play.
He quickly bounced back Thursday with his 15th homer of the year and Jayson Werth added two RBI with a solo blast in the fifth and a run-scoring fielder's choice grounder in the sixth.
Edwin Jackson (8-9) worked eight innings to get the win, giving up only an unearned run on four hits with 10 strikeouts.
After 123 pitches, Jackson was not given a chance to throw what would have been the sixth complete game of his 10-year career.
Jamie Garcia (3-7) gave up Washington's first six runs on nine hits over 5 1/3 to take the loss.