Evan Bouchard tied the game 3-3 at 19:01 of the third period with a long-distance slap shot through traffic, and Hyman scored the game-winner off a cross-ice pass from Connor McDavid with a one-timer from the left face-off circle that went in off the left post.
Leon Draisaitl and Bouchard each had a goal and two assists, and McDavid had a goal and an assist for the Oilers (28-19-8), who have won three in a row for the first time this season after failing to do so on nine previous opportunities. Connor Ingram made 17 saves.
Collin Graf, Adam Gaudette and Michael Misa scored for the Sharks (27-21-4), who had won three of their previous four. Yaroslav Askarov made 28 saves.
Draisaitl cut the deficit to 3-1 at 1:34 of the third. Bouchard's one timer from the point deflected off San Jose defenseman Dmitry Orlov in the slot and through the pads of Askarov before Draisaitl poked the loose puck over the goal line as it sat in the crease.
McDavid brought Edmonton to within 3-2 at 16:55, scoring with a wrist shot from the left circle.
Both McDavid's and Bouchard's goals came while Ingram was pulled for an extra attacker.
Graf opened the scoring just 26 seconds into the first period. Will Smith sent a cross-ice pass to Graf in the left face-off circle, where he put a wrist shot into an open net.
Gaudette made it 2-0 at 1:35 when William Eklund lifted a backhander over Ingram's right pad on a partial breakaway.
Misa extended the lead to 3-0 at 11:40 after his snap shot from the right circle rebounded off Ingram and then deflected in off Bouchard.
Barclay Goodrow appeared to put the Sharks up 4-0 at 6:42 of the second period when he scored into an open net, but officials waved it off because of goaltender interference against Zack Ostapchuk.