Lil Tjay’s getting a raw deal from the NYPD, at least according to his legal team which believes cops had no business searching the "Calling My Phone" rapper's car, leading to his arrest for gun possession.
Attorney Dawn Florio tells TMZ Hip Hop ... Tjay was just a passenger inside the vehicle alongside several other people, and she insists the vehicle was parked legally on the street.
Once police arrived, Florio claims they gave no reason for searching the vehicle and, perhaps most importantly ... she adds, the gun they found does not belong to Tjay.
So, she's claiming the traffic stop itself was bogus -- and, therefore, cops had no right to arrest her client.
Florio thinks NYPD targeted Tjay on account of the social media posts he and fellow Bronx-born rapper Ice Spice put out to promote the filming of the music video for their "Gangsta Boo" collaboration.
Tjay is currently behind bars, waiting to see a judge.