Oleg:
The Sullivan Law, a piece of STATE LEGISLATION, was enacted in 1911. Prior to that, as I understand, anyone could purchase any sort of firearm that was availble for sale. I assume that one could also carry a pistol or revolver on or about their person, any way they wished.
The "special applications" for NYC came later. During his time as governor of New York, from what I've read, the legislature had repealed this legislation, FDR vetoed their repeal. This was at a time when the fees amounted to $0.50.
Also, at the time of passage, electoral violence in NYC was not unknown, and the Democrats who controlled the legislature wished to arm their poll watchers, while they could deny permits to poll watchers of the Republicans.
There was significant immigration from Eastern and Southern Euyrope at about that time, and established groups, who not all that many years previously had themselves been "just off the boat", looked with disdain and suspicion on these new immigrants, who weren't like them.
As has been noted by others, in other venues, the history of gun control proposals in this country is replete with examples of both racism and elitism.
Feel free to correct any historical errors I might have made.