Necas tied it at 4 when he got his 20th goal of the season with 11.5 seconds left in the third period. Then he beat James Reimer again 55 seconds into overtime.
''It was a great finish,'' Carolina coach Rod Brind'Amour said.
Necas scored an overtime winner for the second game in a row, also accomplishing the feat Wednesday night at Dallas. His three overtime winners this season lead the NHL.
''We got a couple of goals and you could feel it was coming for us,'' Necas said.
Sebastian Aho also had two goals for the Hurricanes in their fourth consecutive victory. Andrei Svechnikov assisted on each of Necas' goals.
Calvin de Haan scored for Carolina in the first, and Antti Raanta made 26 stops in his first start since Jan. 7.
The Hurricanes are 9-8 in overtime games.
''We have belief in this locker room that we can win any game,'' de Haan said. ''Having that belief is key, for sure.''
Oskar Lindblom, Nick Bonino, Michael Eyssimont and Mario Ferraro scored for San Jose, which has lost four in a row. Reimer stopped 31 shots against one of his former teams.
Eyssimont had three third-period points, including a go-ahead goal with 8:45 remaining. He assisted on Ferraro's empty-net goal.
''Unfortunately, we've had a lot of practice at losing games in this fashion, so it's just very disappointing for our players,'' Sharks coach David Quinn said.
Aho scored with 1:37 remaining to trim San Jose's lead to 4-3. He has 20 goals, including a power-play tally 17 seconds into the third.
Aho has five goals in a three-game stretch.
''Especially in the third, he was dynamic,'' Brind'Amour said. ''Just a difference maker.''
Bonino has been hot as well with his ninth of the season 6:50 into the third. He has five goals in his last eight games.
''I just loved the way we played, really, for most of the game,'' Quinn said. ''(Our players) deserved a better fate.''
Lindblom scored 15:10 into the first for his fifth goal of the season.
De Haan tied it at 17:33, coming on Carolina's fifth shot of the game. It was the defenseman's first goal in 35 games.
Sharks forward Evgeny Svechnikov and Carolina forward Andrei Svechnikov were on the ice for their second matchup of the season. Each team won once.
Defenseman Jacob MacDonald made his Sharks debut after he was acquired from Colorado in a trade on Wednesday. ... San Jose's Steven Lorentz, a former Hurricane, had his first assist since Nov. 11 on his team's first goal.
Sharks: At Pittsburgh on Saturday.
Hurricanes: Home vs. Boston on Sunday.
AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.