EDMONTON - The Edmonton Oilers did what they had to do for head coach Todd McLellan.

Taylor Hall scored in overtime as the Oilers beat McLellan's old club the San Jose Sharks 4-3 on Wednesday.

Jordan Eberle said the players wanted to give McLellan a victory against a Sharks team that he coached the previous seven seasons - even if it wasn't pretty as they coughed up two leads and had to battle back with a late goal to send it to overtime.

"We wanted to win for him," Eberle said. "We were kind of hesitant and it wasn't our best game, but when we needed to push back and score, we did, and we got the two points and kept our streak alive."

Eberle, Leon Draisaitl and Ryan Nugent-Hopkins also scored for the Oilers (12-15-2), who have won four games in a row.

McLellan said the game was a stressful one, but not because of watching San Jose from a different view point.

"There were some ups and downs," he said. "We went from a high to a low and frustration on mistakes. I was really happy with the execution on the tying goal. In overtime I was still angry because I thought they had too many men on the ice as we were scoring. That kind of sums up my night."

Justin Braun, Patrick Marleau and Joe Pavelski responded for the Sharks (14-13-1), who have lost five straight.

"I was real happy with our effort, I thought we could have had two or three in the first and we came ready to play," said Sharks coach Peter DeBoer. "For us playing back-to-back and four in six nights, I thought we gave a hell of an effort and probably deserved better."

After a scoreless first period, Edmonton finally put a goal on the board six minutes into the second when Teddy Purcell made a nifty pass at the blue line to Draisaitl, who beat Sharks goalie Martin Jones through the legs for his ninth of the season on a partial breakaway.

The Sharks tied the game four minutes into the third period as Braun was able to beat Oilers goalie Anders Nilsson with a backhand shot through traffic for his first goal in 68 games.

The Oilers made it 2-1 eight minutes into the third when rookie Jujhar Khaira fed it in front to Eberle, who spun around and sent a no-look backhand shot top shelf past Jones for his third goal in as many games.

San Jose tied the game again with nine minutes remaining as Tomas Hertl found Marleau at the side of the net and he netted his 11th of the season.

The Sharks then took the lead a minute-and-a-half later when Pavelski was left alone in front and was able to bat in the puck from mid-air from the edge of the crease.

Edmonton fought back to make it 3-3 with 4:37 remaining as Pakarinen took a shot from the top of the circle that Nugent-Hopkins tipped past a screened Jones.

The Oilers grabbed the two points 3:59 into the overtime session as Draisaitl fed Hall on a two-on-one and he reached out to tip in his 12th of the year.

Edmonton wraps up its five-game homestand on Friday against the New York Rangers. The Sharks return home to face the Minnesota Wild on Saturday.

Notes: Out with injuries for the Sharks were Ben Smith (concussion) and Marc-Edouard Vlasic (lower body)… Absent from the Oilers lineup were Connor McDavid (collarbone), Rob Klinkhammer (leg), Nail Yakupov (ankle), Benoit Pouliot (lower body) and Andrew Ference (undisclosed).