Washington Irving's Salmagundi lampooned New York culture and politics in a manner much like Mad magazine in modern times. In 1807, Irving attached the name "Gotham" to New York City for the first time. The association was based on the alleged stupidity of the people of Gotham.

More Info: en.wikipedia.org