EDMONTON, Alberta — The Sharks dug themselves out of a two-goal hole in the third period Wednesday night en route to a 4-3 shootout victory over the Edmonton Oilers that ended San Jose's five-game road losing streak.

Two goals by Logan Couture and one that tied the game at 3-3 by Tommy Wingels provided the San Jose offense in regulation, and the Oilers got goals from Sam Gagner, Shawn Horcoff and Ryan Jones.

In the shootout, Couture and Dan Boyle scored for San Jose, and Jordan Eberle was the only Oilers shooter to get the puck past goalie Antti Niemi.

Though the Sharks held a two-point edge on Edmonton in the tightly bunched Western Conference standings entering the game, the teams were heading in opposite directions. The Oilers were 3-0-1 in their last four, while San Jose had only one victory in its previous seven games.

Edmonton opened the scoring when the Sharks gave up their first power-play goal in three games as Gagner's seeing-eye shot from the left faceoff circle beat goalie Niemi at 10:47 of the first period.

But the Sharks showed good perseverance around the net to tie the score at 1-1 when Couture threw the puck toward Oilers netminder Devan Dubnyk and it caromed into the crease off his own defenseman's skate at 14:19.

Marty Havlat earned an assist on that goal, but in the second period he put San Jose in jeopardy when he complained about a questionable interference penalty and earned an extra two minutes for unsportsmanlike conduct, plus a 10-minute misconduct.

The Sharks killed off the two minors but fell behind 2-1 seconds after Couture hit the post on a San Jose power play.

As the puck came back down the ice, Oilers defenseman Nick Schultz's penalty expired, and he helped set up an odd-man rush that ended with Horcoff's goal at 12:07.

Edmonton made it a 3-1 game early in the third period when Jones stole the puck from Matt Irwin behind the San Jose net and tucked the wraparound in before Niemi realized what was happening at 4:07, but the Sharks tied the game a little more than five minutes later.

Couture's second of the night came on a power-play shot at 6:50 from the right faceoff circle after Joe Thornton dug the puck out from under an Oilers defenseman.

And Wingels tied it at 9:15 after TJ Galiardi won a battle along the boards and got the puck to him for a 33-foot wrist shot.