"I was surprised," said Ovechkin, whose 20 goals lead the NHL. "I don't have a good backhand, but it goes in. I try to do it again in the third period, but I don't have that skill. One worked. I'll take it."
WATCH: [All Sharks vs. Capitals highlights]
Devante Smith-Pelly, Brett Connolly and Jakub Vrana scored, and Philipp Grubauer made 24 saves for the Capitals (16-11-1), who have won 11 of their past 16 games.
Capitals forward T.J. Oshie left the game with an upper-body injury at 16:34 of the second period after Sharks center Joe Thornton hit his head into the boards in the Washington zone. Coach Barry Trotz did not have an update.
Timo Meier scored for the Sharks (14-10-2), who have lost two in a row following a three-game winning streak.
With San Jose on the power play, Justin Braun played the puck from the point off the end boards, and it caromed in front to Meier for a shot past Grubauer at 11:32 of the second period to cut Washington's lead to 2-1.
Grubauer's best save came at 4:34 of the third period when he anticipated a pass from Jannik Hansen to Marcus Sorensen and made a sliding right-pad stop at the left post.
Smith-Pelly gave Washington a 1-0 lead when he tipped a John Carlson shot past goalie Martin Jones at 16:49 of the first period. The goal ended Jones' shutout streak at Capital One Arena at 136:43. Jones (25 saves) lost to the Capitals for the first time (4-1-0).
Connolly scored off a pass from Ovechkin on the power play with 52 seconds left in the second to make it 3-1.
The NHL Situation Room determined the puck crossed the goal line on Connolly's shot after play was stopped at 19:21. San Jose coach Peter DeBoer challenged that Washington was offside prior to Connolly scoring, but the goal was upheld by video review.
Vrana scored off a pass from Tom Wilson on the power play at 11:36 of the third period to make it 4-1.
Ovechkin needed 949 games to reach 578 goals. Recchi did it in 1,652.