It surprises me that both the "progressive/liberal" republican party of the 19th and early 20th century and the conservative republican party of today both get crushed there.
Did NYC switch from conservatism to liberalism at the same time the Rs switched from liberalism to conservativism?
The Republicans have generally always been the party of business and of religiously (Protestant) motivated crusades (In those day's abolition and prohibition/temperance, as well as the public schools).
All of those reforms were opposed by the German and Irish Catholic immigrant groups. Abolition would bring blacks into competition for their jobs whilst slavery kept them safely down south (Dred Scott is in my view the key that causes this viewpoint to shift as it raised the specter of slavery itself bringing about that very competition. Hence why Lincoln emphasized "all Slave or all free". It was brilliant political strategy as it forced these pro-slavery northerns to flip and vote for a moderate anti-slavery Republian like Lincoln both in 1858 [he won the collective popular vote but lost since Senators were elected by state legislature] and 1860. This did not include NYC where Lincoln lost and barely carried the state by a narrow margin thanks to solid support upstate and NYC was one of the hotbeds of copperhead sympath during the war (Fernando Wood?) as well as the site of the NYC draft riots (those same pro-slavery working class Irish Democrats against the blacks)). Prohibition of alcohol interferred with the strong heritage of strong spirits and beer amongst those immigrant groups. Also the Republicans being of Congregational (Puritan) New England and Midwestern stock largely, preferred that the King James Bible be read in said public schools and Catholic immigrants wanted nothing to do with that. So instead they opened parochial schools and Republicans tried to ban school choice to force them to go to public schools and be tought the "good (Protestant) Christian education lest they be condemned to hell for eternity".
German immigrants typically did not have any particular opposition to abolition itself. The Kansas-Nebraska Act was deeply unpopular, and the "forty eighter" immigrants especially were strongly anti slavery. The main obstacle to German immigrants in supporting the Free Soil and Republican parties was the association with nativism and prohibition, and the traditional allegiance to Democrats of German Americans from older waves of immigration. Germans ended up voting Republican, bringing an anti-nativist, anti-prohibition voice into the party.
Looking at the House vote on the 18th amendment, the Republican and Democratic parties both voted roughly 2-1 in favor. The opposition to prohibition among Democrats in the North was overwhelmed by the support for it among Democrats in the rest of the country.