Jon Heyman of MLB Network reported the news.
Panik, a 2015 All-Star, struggled mightily this season before being let go by the Giants. He was hitting .235/.310/.317 with three home runs and 27 runs batted in through his first 103 games played.
It continued a marked downward trend for the 28-year-old, who burst on the scene in 2015 before watching his numbers slowly decline.
Speaking about Panik's release, Giants shortstop Brandon Crawford told reporters:
"That's tough because you're losing a guy I played up the middle with for (six) years and was a big part of our team. On top of that, he became a good friend and a great teammate.
"That part's obviously tough. Probably one of the tougher parts of this business. The longer you're in it, the more you're going to see stuff like that. It's definitely tough to lose somebody like Joe."
Panik will be arriving in New York to replace Robinson Cano, who was also a disappointment after coming over in an offseason trade from Seattle.
Cano seemed to be flipping a switch at the beginning of August with nine hits in his first 15 at bats before suffering a torn hamstring. He's considered out indefinitely, and it's possible he misses the remainder of the regular season.
Winners of six straight games, the Mets have moved themselves into wild card contention. They are only 0.5 games behind the Milwaukee Brewers for the second spot. Five teams are within three games in a tight race that should come down to the season's final week.
Panik will have to perform better in New York than San Francisco to make the type of difference the Mets need.