Welcome!!
1. GoodFellas
2. Donnie Brasco
3. Casino
4. American Gangster (not about the mafia per se, but they're in it and the era was depicted brilliantly imo)
5. Gotti
Godfather is the best ever of course, but you asked about based on real life so I chose movies based on true events..
Yeah, that's EXACTLY why I don't consider AG to be a gangster movie. It's a drug dealer/crime movie, to me, not a gangster movie.
Gotti was good, but, too factually incorrect for me.
Sorry it took so long for a resposne.