Casanova TMZ/Getty Composite

Casanova is begging a judge for mercy ahead of his sentencing after pleading guilty to drug trafficking and RICO charges ... and he wants the court to know he's no longer associated with the gang that got him into trouble in the first place.

In new legal docs, obtained by TMZ Hip Hop, the embattled Roc Nation rapper lays it all out in an emotional letter to the judge ... in which he fully renounces his gang ties to the Gorilla Stone Nation Bloods and promises to continue speaking out against gang life.

Casanova says he's not denying he's made some bad decisions, after all, he did plead guilty to the drug trafficking charge ... saying he used the gang life to build an image in the rap community and sell music but insisting he no longer wants to live that life.

Waiting for your permission to load the Instagram Media.

ncG1vNJzZmivp6x7tbnZZ5qopV9nfXN%2FjmltaGllZLCiv8Cnpq%2BZXaeyr7vUp5qeq12cvLO1y6WYZqukpLumecaapaBlpJ6ytHnLnqutnaJit7awxp5m