SAN JOSE — Zack Ostapchuk and Collin Graf both scored first-period goals, and William Eklund added one in the second as the San Jose Sharks started fast and earned a 4-1 win over the Toronto Maple Leafs on Thursday at SAP Center.

Goalie Alex Nedeljkovic made 18 saves, including eight in the third period, as the Sharks (36-31-7) won their fourth straight game and, via points percentage, moved into the Western Conference’s second wild card spot.

Adam Gaudette added an empty net goal with 56.9 seconds left in the third period for the Sharks, who improved to 3-0-0 on this critical six-game homestand.

San Jose, Los Angeles, and Nashville now all have 79 points after the Kings lost 5-4 in a shootout to the Predators late Thursday night. The Sharks, having played one fewer game, have a .534 points percentage, compared to .527 for the Kings and Predators.

The Sharks next play the Predators on Saturday in another massive game.

The Sharks were coming off an emotional 4-3 comeback win over the Anaheim Ducks on Wednesday. Macklin Celebrini scored with 1:39 left in the third period to tie the game 3-3, then assisted on Alex Wennberg’s go-ahead goal with 31 seconds remaining to complete a four-point game.

Celebrini did not have a point against the Leafs, marking only the second time in 20 games this season that the Sharks have won when their leading scorer hasn’t recorded a point.

The other time it happened was on Jan. 19, when Michael Misa and Igor Chernyshov each had two assists in a 4-1 home victory over the two-time defending Stanley Cup champion Florida Panthers.

“It’s something we talked about, right? We need guys to contribute in a lot of different areas,” Sharks coach Ryan Warsofsky said. “The more guys we get going, the more guys contributing, is going to help our group in the long term.”

The Sharks, who were 4-7-2 in the second half of back-to-back games before Thursday, built a 2-0 lead after the first period.

Ostapchuk scored his fourth goal of the season at the 3:27 mark on San Jose’s first shot of the game, as he streaked in on the right wing and beat Leafs goalie Anthony Stolarz with a shot that appeared to change direction.

Then, after a Sharks forecheck resulted in a Leafs turnover, Graf took a pass from Misa and beat Stolarz for his 20th goal of the season.

“It’s exciting. If you asked me at the start of the year, I probably wouldn’t have said I would have gotten there. It’s a nice milestone to get,” Graf said. “It’s an even bigger two points. We’re all working toward playoffs here.”

Eklund’s goal snapped a 10-game goal drought, as his shot from near the slot was deflected wide. The puck coming off the end boards, though, got caught in Stolarz’s equipment as he slid backward, and crossed the goal line for Eklund’s 13th goal of the season.

Leafs center John Tavares scored a power play goal at the 6:43 mark of the second period to cut the Sharks’ lead to 3-1, and Toronto was the more active team for other large parts of the game

Coming off Wednesday’s comeback win, Warsofsky said he addressed the possibility of an emotional letdown Thursday morning.

“Anytime you have an emotional win, the natural human reaction is to kind of come off it a little bit,” Warsofsky said. “We’ve got to make sure what happened last night doesn’t affect our game today.

“We can’t just ride a high again. We’ve got to move on. It’s a big two points that we got, but yesterday doesn’t mean anything if we don’t get two tonight.”

After Saturday, the Sharks close the homestand with games against the Chicago Blackhawks on Monday and the Edmonton Oilers on Wednesday.