OED has the following as its earliest cite.
1953 in H. Wentworth & S. B. Flexner Dict. Amer. Slang (1960) 236/1 The gun-slinger will spend..his life behind bars.
Going to the Corpus of Historical American English (thanks to Dave for reminding me of this database and COCA) I see it has a much earlier cite.
1932, Robbers Roost (fic) “ he replied, sadly.
I’m only a wandering rider—a gun-slinger and—a member of a gang of robbers. And I was mad enough ....
I shall certainly be supplementing OED and the other reference sites I use with these two in future and it’s so refreshing to see that they are freely available to all.
To save my life, I could not find the quote “I’m only a wandering rider--a gun-slinger and--a member of a gang of robbers...” on COHA. I clicked on search and on the number below 1930, but I did not see the quote.
Clicking on the number below 1930 should bring up all the 30s cites, in this case just one, that of 1932. I’m not sure why it’s not working for you. Perhaps you need to be registered although I didn’t think so. Try clicking on gunslinger itself, that should bring up the whole range of cites.