Kevin Labanc scored, and Martin Jones made 24 saves for the Sharks (34-17-7), who are tied with the Calgary Flames for first in the Pacific Division and with Calgary and the Winnipeg Jets for first in the Western Conference.
San Jose center Joe Thornton had an assist for his 1,458th point, moving him past Teemu Selanne for 15th in NHL history.
"We didn't compete hard enough tonight, and they went all-in," Sharks forward Evander Kane said. "They won all the puck races. They had their skate legs, and we didn't. We didn't execute in the middle of the ice and the middle of the zone. They had a lot of transition opportunities off that."
The Capitals avenged a 7-6 overtime loss to the Sharks at Capital One Arena on Jan. 22 and bounced back from a 3-0 loss at the Columbus Blue Jackets on Tuesday.
"Just from the drop of the puck, guys were excited to play, guys were just happy and having fun," Oshie said. "And if anyone knows anything about this team, we play our best when we're having fun."
The Sharks took a 1-0 lead at 2:06 of the first period when Labanc took a cross-ice pass from Thornton and scored on a wrist shot from the right face-off circle.
Oshie tied it 1-1 with a power-play goal at 3:38. He tracked down an Ovechkin rebound near the goal line and banked the puck off Sharks defenseman Marc-Edouard Vlasic and into the net.
"He's incredibly talented, has a good feel for the game," Capitals defenseman Matt Niskanen said of Oshie. "I think he's a really good fit with any combo of those top six forwards, and he plays with a ton of enthusiasm and energy."
Vrana put Washington ahead 2-1 at 11:33 when he scored on a 3-on-2 rush.
Ovechkin made it 3-1 at 4:14 of the second period, scoring on a slap shot from the left circle.
Oshie scored again at 18:02 of the second on a breakaway to make it 4-1.
Wilson scored an empty-net goal with 2:35 remaining for the 5-1 final.
"They were hungrier and a little bit better than us," said Sharks coach Peter DeBoer, whose team was coming off a 4-0-0 road trip. "We had some pretty good nights in the last month, and tonight wasn't our best and we couldn't outscore our problems tonight. The first game after a trip like that is always tough, no matter what. They are a good team, and if you aren't right on, you are going to have a hard time. I think that was the case tonight. The details of our game weren't great."