A "gangsta" A.K.A. a "G" is one who had to commit illegal and or offensive acts for the sake of surviving, despite if he or she wanted to do it. If one does such an act(s) and has other options, then he/she is not a gangsta.
Although the term is often glorified in Hip Hop, Rap, and Pop music and culture, a real gangsta will tell you it's not a life you should WANT. Most people who never lived or know the life are often misled to the term being a good thing.
He lost his job and was forced to sell crack, just to put food on the table for his family this week. That's gangsta.