SAN JOSE — Sharks coach Todd McLellan felt it might take some time for his team to get its rhythm back after a four-day layoff between games. Things began to click Thursday midway through the third period, and San Jose’s young players were the ones who took over.

Matt Tennyson scored his first NHL goal to tie the score with 11:31 to go in the third on the power play, and 34 seconds later fellow rookie Barclay Goodrow netted the winner as the Sharks earned a 4-3 come-from-behind victory over the Edmonton Oilers before an announced crowd of 17,399.

Rookie Melker Karlsson had two assists for the Sharks, who now have won seven straight at home and eight of their last nine overall to move into second place in the Pacific Division.

“We had four rookies in the lineup,” Sharks coach Todd McLellan said, “and they’re really starting to feel like they belong.”

Goodrow, who also assisted on James Sheppard’s second-period goal, gave the Sharks the lead for good as he took a nice stretch pass from Brent Burns, fought off a check from Edmonton’s Justin Schultz and beat Oilers goalie Ben Scrivens with a backhand shot on a partial breakaway.

“I didn’t have any speed when I got the puck, so I figured one guy would end up catching me,” Goodrow said. “So I just tried to fend him off as best I could and the goalie slid over a bit, so I thought I’d have a bit of room on the far side. Luckily it went in.”

San Jose’s defensemen were aggressive in carrying the puck into the Oilers zone at various times Thursday, and it paid off with the tying goal.

The Sharks trailed 3-2 going in the third period when Tennyson took a pass from Tommy Wingels, skated over the blue line and beat Scrivens with a wrist shot.

It was a historic moment for the franchise, as Tennyson, formerly of Pleasanton, is the first graduate from San Jose’s Junior Sharks program to score for the Sharks.

McLellan said one of the dreams of George Gund III, the Sharks’ former owner, was to have “somebody who played in the Junior Sharks system actually play for the Sharks and score a goal. So hopefully he’s looking down and he’s really proud of bringing the team here, and it finally happened after 23-24 years.”

With San Jose ahead 2-1 in the second period, Edmonton’s Steven Pinizzotto batted home a loose puck in front of the Sharks’ net to tie the game. Shortly after, Ryan Nugent-Hopkins gave Edmonton the lead off a shot by Jordan Eberle that goalie Antti Niemi wasn’t able to corral.

Niemi settled down in the third period, though, making seven saves to get the win in what was the 300th game of his NHL career. It was Niemi’s second straight start after he stopped 29 shots in Saturday’s 2-0 win by San Jose over Nashville.

The Sharks entered Thursday about as rested as they’ve been all season, as they have had one day off and three practice days since their last game on Saturday. But the extra rest also might have had a down side, as the momentum the Sharks had built last week with three straight wins was going to be hard to recapture.

“It took us a while,” McLellan said. “After two periods, I didn’t think we were assertive at all. They were winning the puck to the net and the battle in the blue paint game quite easily.”

Boyd Gordon opened the scoring with a backhand shot beat Niemi on the glove side for a 1-0 Oilers lead. Sheppard and Logan Couture both scored in the second period to give the Sharks the lead.