I found it earliest referring to Chicago and San Francisco, not New York.
Making of America
Title: The land of Thor. By J. Ross Browne ... Illustrated by the author.
Author: Browne, J. Ross (John Ross), 1821-1875.
Publication Info: New York,: Harper & brothers, 1867.
So help me, friends and fellow-citizens, I'd sooner by a pack-mule in California with a raw pack, and be owned by a Mexican greaser, employed week in and week out in carrying barrels of whisky over the Downieville trail, fed on three grains of barley per day, and turned out to browse on quartz rock and sage-brushes every night -- I'd rather be a miserable little burro, kicked and cuffed by a Mariposa Chinaman -- I'd rather be a dog and bay the moon in the city of Oakland, or a toad and feed upon the vapors of a dungeon at San Quentin -- I'd rather be a lamp-post on the corner of Montgomery Street, San Francisco, and be leaned against, and hugged, and kissed alternately by every loafer out of the Montgomery saloon -- I'd rather be any of these than a human being compelled o live permanently in Europe, with a palace in every city, town, and village, and an income of fifty thousand dollars a day to defray expenses; so don't be surprised if I should turn up again one of these fine mornings on the Pacific coast.
8 June 1872, Chicago (IL) Daily Tribune, Idaho, pg. 3:
This lack of population is apt to give rise to unjust remarks, and I recently heard one full-fledged mountaineer say emphatically that he "would rather be a lamp-post in San Francisco than be Governor of the Territory." Judging from the appearance of the said mountaineer, this is by no means flattering either to the lamp-posts of San Francisco, or to the Governor of this Territory, whomever he may be.
20 February 1879, Chicago (IL) Tribune, pg. 4, col. 6:
Certain Illinois legislative junketers passed Sunday in St. Louis at the expense of the State. Of course they had no business there; but we can almost forgive them all for the remark of one of them, that he "would rather be a lamp-post in Chicago than Mayor of St. Louis."
20 June 1886, New York (NY) Times, Pg. 14:
I remembered hearing some fellow say once that he'd "rather be a lamppost in New-York than a King anywhere else," and I felt that way myself.
5 October 1894, New York (NY) Times, pg. 3:
A gentleman told me yesterday he would rather be a lamppost in New-York than be the Mayor of any other place.
8 November 1907, New York (NY) Times, pg. 8:
Such a one said to me a day or so ago: "I would rather be a lamppost on Broadway than Mayor of Buffalo."