Olaf Kolzig made 25 saves to get the win and help the Capitals capture their fourth victory in five games. Buffalo had won the previous three meetings between the teams this year.
Washington, currently in 10th place in the Eastern Conference, inched within a point of Buffalo and to within two of eighth-place Philadelphia in the tight playoff battle.
Ovechkin has delivered nine points in his last three games with six goals and three assists.
He scored on a breakaway with 4:39 left in the first period and his other goal made it 3-1 with 6:41 remaining in the third. Ovechkin has scored 152 goals over the last three seasons, the most by any player in that span.