NY...until 1827. People were still coming to my area in upstate as early as 1815 Upstate from Massachusetts which was a free state.
One should also take into consideration that New York City profited a great deal from slavery in the American South as cotton and other goods from those states were processed through it’s harbour (along with Boston’s). When you got up to areas like Albany, Syracuse, Rochester, Central Leatherstocking, and elsewhere, they were staunchly pro Republican and anti slavery in contrast to NYC’s Democrat and pro slavery leanings.