The feeling was strange, but sweet. It was unfamiliar, yet comfortable.

For the first time, Joe Panik was playing for an organization other than the Giants. For the first time in eight years, the former St. John’s star was playing for his hometown team.

After being designated for assignment by the team he helped win a World Series in 2104, the 28-year-old former All-Star and Gold Glove winner signed with the Mets on Friday afternoon and was immediately inserted into the starting lineup to debut against the Nationals, helping fill the void caused by Robinson Cano’s torn left hamstring.

“I was ecstatic because you never know in these types of situations what’s gonna happen,” said Panik, who went 1-for-4 with a hit in the ninth inning of the Mets’ wild 7-6 victory over the Nationals. “It couldn’t have worked out any better for myself. A lot of family, a lot of friends in the area. For me, to be coming to a club that’s hot right now, in a playoff push, it’s very exciting. For me, it’s a great situation.

“Honestly [general manager Brodie Van Wagenen] didn’t have to sell me. Seeing this team from afar, hitting against this pitching staff, this is a place I definitely wanted to be. It definitely wasn’t difficult once I went unclaimed.”

Panik, who was born in Yonkers and grew up in Dutchess County, became a free agent after clearing waivers at 1 p.m., and was quickly scooped up by the Mets, who will pay the prorated portion of the minimum salary.

“For what happened with Cano, and to have Panik available, that’s unbelievable,” manager Mickey Callaway said. “We kind of lucked out on that one.”

Drafted by the Giants in the first round in 2011, Panik debuted with San Francisco in 2014, and appeared in each of their 17 games that postseason, including their World Series triumph over the Royals. Panik became an All-Star the next season, finishing with a .312 batting average, and earned a Gold Glove the next year.

This year, the career .271 hitter has hit just .235, with a .627 OPS, leading to the end of his tenure with the Giants.

“To get to a new team, new place, new faces, for me it’s a fresh start, and I’m excited about that,” Panik said. “Anytime you get into a playoff push like this, it reenergizes you and gets you excited.”

Callaway said he currently isn’t planning for Panik to be the everyday second baseman, citing Jeff McNeil’s potential need for breaks from playing the outfield.

Cano, 36, remains without a timetable for a potential return, but the eight-time All-Star said he felt better less than a week after suffering the injury, and is holding on to the slim hope he can return before the season is over.

“I’m always positive. Why not play this year? We’ll just see how it feels,” Cano said Friday, discussing the injury for the first time since landing on the injured list for the third time this season. “It’s sad because I want to play. Life sometimes doesn’t go the way you want. … You have to deal with it. It’s hard right now because I want to be out there playing and helping this team win games.

“I’m always positive, and I’m gonna do everything that’s in my hands to get ready and back out there this year. … Let’s see what happens.”