Yeah city is not fully a function of zip. ~I think state is though.~* I believe when multiple cities share a zip code USPS uses the larger one. Usually the wrong city will get delivered though, probably not guaranteed.
* correcting myself, some zip codes do cross state lines