K80Geoff is incorrect. NYC does not treat long guns and handguns the same, and you are allowed to stop within the city with an unloaded long gun.
A non-resident does not need a license for transportation of long guns through the city. A non-resident may bring an unloaded long gun into NYC, and leave it there for no more than 24 hours.
Here is the actual law:
NYC Administrative Code, § 10-305. Exemptions.
i. (1) Non-residents in transit. Any other provision of this chapter to the contrary notwithstanding, a non-resident of the city of New York who, without a rifle and shotgun permit issued hereunder, enters the city of New York possessing a rifle or shotgun in the course of transit to a destination outside the city of New York, or a non-resident of the city of New York who enters the city of New York possessing an assault weapon in the course of transit to a destination outside the city of New York, shall have a period of twenty-four hours subsequent to such entering to be exempt from penalty under this chapter for the unlawful possession of a rifle, shotgun or assault weapon, provided that such rifle, shotgun or assault weapon shall at all times be unloaded and in a locked case, or locked automobile trunk, and that said non-resident is lawfully in possession of said rifle, shotgun or assault weapon according to the laws of his or her place of residence.