Johnson earned his third straight triumph, allowing only a goal by Milan Lucic with 35 seconds remaining in the second period that cut Boston's deficit to 2-1.
That is the way the score remained until Alex Ovechkin clinched the victory with an empty-net goal 52 seconds from the final horn. It was his 15th of the season.
Nicklas Backstrom and Alexander Giroux also scored for the Capitals. It was the first goal of the season for Giroux and the third of his career. He was recalled last Sunday from Hershey of the American Hockey League.
Boston, which sits atop the Eastern Conference with 42 points, lost for just the fourth time in 21 games.
Manny Fernandez took the loss while stopping 22 shots.