5:29 AM PT -- 6/7 -- According to the NYPD ... Lil Tjay was perched on the sunroof of a moving vehicle while waving an apparent firearm. Police took him into custody and recovered the "weapon," which turned out to be a fake gun. Tjay was charged with criminal possession of a weapon for the imitation pistol.
His attorney said he was also charged with reckless endangerment for displaying the prop gun and obstructing governmental administration for refusing police orders to put his hands behind his back during his arrest.
Lil Tjay is in police custody once again ... his lawyer says the rapper got arrested in NYC -- second time this year -- and this time it all went down live on Instagram.
Tjay's lawyer Dawn Florio tells TMZ ... the rapper was filming a short clip for a music video when cops arrived on the scene in Manhattan, and took him in for reckless endangerment.
He captured his arrest on video, too, as he happened to be live streaming Tuesday during the ordeal. Some folks in the crowd told him to stop resisting as his phone ended up in someone else's hand.
TikTok / @hijoshotit
TMZ broke the story, the 22-year-old was arrested in January after a traffic stop in the Bronx while en route to shoot a video with Ice Spice. Law enforcement sources told us cops found a handgun in his vehicle, resulting in him getting booked for weapon possession.
Of course, the guy's also lucky to be alive after getting shot 7 times in a 2022 New Jersey robbery.
We've reached out to the NYPD's press office for comment ... so far, no word back.