Strasburg lasted just two innings before leaving the shortest outing of his career. He will head back to Washington to have his side examined.
The victory snapped a two-game skid for Washington, which trimmed its second-place deficit in the NL East to 4½ games behind the Braves.
Atlanta has dropped two of three and four of six.
Strasburg left with a 2-1 lead. He allowed two hits and one run — a homer by Freddie Freeman — with no walks and two strikeouts.
Stammen (3-1) shut down the Braves by striking out three and allowing no baserunners through the sixth.
In the seventh, Tyler Clippard escaped a bases-loaded jam that he created by allowing an RBI single to Freeman that cut the lead to 3-2 and by hitting the next two batters he faced.
Clippard settled down, though, and struck out Dan Uggla and Chris Johnson.
Drew Storen pitched a scoreless eighth for the Nationals, and closer Rafael Soriano converted his 15th save in 18 chances by retiring Freeman on a flyout, striking out B.J. Upton and getting Brian McCann to ground out in the ninth.
The Nationals took the lead in the first off Julio Teheran (3-2) when Span led off with a triple and scored on Steve Lombardozzi's sacrifice fly.
Washington went up 2-0 in the second. Roger Bernadina singled, advanced to third on Danny Espinosa's single and scored on Kurt Suzuki's fielder's choice RBI.
Freeman's solo homer in the fifth cut the lead in the bottom of the second, but Strasburg struck out Evan Gattis on five pitches before McCann stepped in.
Strasburg was behind two balls, no strikes when he grimaced after throwing a changeup. He flexed his shoulder before throwing the next pitch and soon retired McCann on a groundout. Strasburg then struck out Uggla on five pitches, but his night was over.
Stammen was already warming up in the bullpen while Strasburg spoke in the dugout with manager Davey Johnson, pitching coach Steve McCatty and trainer Lee Kuntz and was told of the team's decision to pull him out.
Stammen retired all 12 batters he faced. He was replaced by a pinch-hitter in the top of the seventh.
The Nationals took a 3-1 lead in the sixth when Span tripled again and scored on another sacrifice fly by Bernadina.
Teheran's night ended when Anthony Varvaro replaced him with a runner on second. Teheran allowed seven hits, three runs, one walk and a career-high nine strikeouts.