First, you should use city with capital c too, New York City. And the is not necessary if you are referring to the city only, but if you have a noun following the name, and you referring to it "the" is necessary. eg the New York City agency.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.