The shooting that left a hole in the stomach of a Tekashi69 crew member was triggered by threats of gun violence and death ... threats coming from the rapper's own muscle.
Law enforcement sources tell TMZ ... Tekashi's crew tried to bully its way into the NYC restaurant where 6ix9ine was supposed to meet with a record exec. The rapper's security was turned away and threatened to shoot the men who wouldn't let them in.
We're told Tekashi was meeting record exec Elliot Grainge for dinner. Elliot was waiting for Tekashi at the restaurant with his two bodyguards, retired NYPD detective Efrain Vasquez and Maurice Fernandez.
When Tekashi arrived with his 7-person entourage, a fight broke out after Fernandez told Tekashi's crew they weren't welcome. 6ix9ine then called off the meeting and left.
Some of Tekashi's crew stayed behind and for some reason insisted on entering. One of the men allegedly shouted, "F*** this, I'm getting inside!"
Fernandez texted Vasquez -- who was inside -- telling him Tekashi's men were trying to force their way in and feared they had guns.
Vasquez charged outside to back up Fernandez, and then Tekashi's crew member, Shottie, allegedly threatened them, saying, "I'm going to violate you both with gunshots."
One of the men in 6ix9ine's group then allegedly yelled, "Shoot these motherf***ers! Gunfire!"
One of Tekashi's associates allegedly struck Vasquez in the head with a chair ... and two witnesses said Shottie was the man wielding the furniture.
Vasquez saw one of Tekashi's guys pull up his shirt and reach for something in his waistband ... that's when Vasquez brandished his gun, firing 2 rounds and hitting one of Tekashi's crew in the stomach.
Everyone scattered after gunfire erupted, but police tracked down and arrested 2 of the 3 Tekashi associates allegedly involved in the melee ... Faheem "Crippie" Walter and Zachary Bunce.
Shottie -- real name Kifano Jordan -- has not been apprehended.
Lance Lazzaro, the criminal defense attorney who reps Tekashi, Shottie and the 2 men, tells TMZ ... "It is my understanding that Tekashi was not present when the incident occurred. Shottie has no involvement with any criminal act. The two other men were victims of an assault. The charges will be completely dismissed at some point against them both."
It's interesting ... just hours before the shooting, Tekashi got off with probation in his child sex case and the judge warned the rapper to stay out of trouble or risk going to prison.