1896, Amer.Eng., from
gang (q.v.) in its criminal sense.
Gangland is from 1912.
Gangsta rap style is generally credited to West Philly hip hop artist Schoolly D, but his "Gangster Boogie" (1984) used the conventional spelling; NWA was spelling it
gangsta by 1988.