The arrival can instead be in Philadelphia station, or Newport RI.
NJ has difficult purchase procedures, but if you own a gun legally and are passing through they're "fine" as long as you comply with the normal reuirements (unloaded, locked in separate container, and unloaded means allmags, clips, and speedloaders must be empty).
NYC isn't going to give you a permit, no how, no way. Driving through Manhattan with a firearm locked in the trunk of a car would seemingly be legal, but apparently isn't.
I'd go the long way around Long Island to avoid going through NYC waters with firearms. Make your arrival at Newport, RI instead if you're going offshore the entire way. Or clear in in a gun-friendly state further south along the coast, and adjust your itinerary as desired.
The USCG may carry guns and have many pro-gun people, but they will turn you over to local LE if they find you to be in violation of local ordinances, and NYC has ordinances.
I hate not being able allowed to carry on my boat around here.