Noah Gregor scored two goals, Logan Couture had two assists, and James Reimer made 26 saves for San Jose (32-36-13).
"I thought we played strong for most of the game, we had a lot of O-zone time which is something we haven't been able to do a lot throughout the year, so that was a big positive," Gregor said. "But holding on to leads, we weren't quite able to do it, and when you're in those situations you can't let them back in the game. Then they win it in overtime."
Gregor gave the Sharks a 1-0 lead at 2:42 of the first period after Koskinen played the puck into the corner off a shot from Jonah Gadjovich and Sasha Chmelevski fed Gregor in the right face-off circle. He scored 26 seconds later to make it 2-0 when his centering a pass went in off the skate of Oilers defenseman Evan Bouchard. It was Gregor's first two-goal game in the NHL.
"It was nice, there were lots of family and friends in the crowd," said Gregor, who is from Beaumont, Alberta, an Edmonton suburb. "It's nice to score a goal at any time in the NHL, but in your hometown, it's extra special."
Ryan McLeod cut it to 2-1 on the power play at 9:17 of the second period, scoring on a rebound.
Yamamoto tied it 2-2 at 12:52, converting from the slot off a behind-the-back pass from Leon Draisaitl on a 2-on-1.
"It was one of those ones where we knew we weren't fully on the top of our game," Oilers defenseman Brett Kulak said. "But we knew we could trust our process and go back to the simple things and keep chipping away at it. We have a lot of offense, we don't really have an issue scoring goals. We just kind of stuck with it and ended up getting it done."