Scherzer appeared to be fatigued by the injury while attempting to run out a groundball in the top of the fifth, but still made it back to the mound to retire three more batters.
He managed 75 pitches and kept the Milwaukee Brewers to one run before exiting, allowing two hits and a pair of walks while striking out two.
Up with two out in the first inning, Shaw grounded out sharply back to the mound. After the ball hit Scherzer in the landing leg, the Nationals ace collected himself and retired him for the final out.
Washington activated Scherzer off of the disabled list at the end of August after he was sidelined for 15 days with a neck injury.
At 81-53 heading into Saturday, the team has a commanding lead over its division and seems poised to face the winner of the National League Central in the NLDS, which is still a month away.