Rapper Tekashi69 -- the stage name for Danny Hernandez -- shattered the informal code of silence typical of celebrity defendants and spoke about gang ties in the entertainment industry during a court appearance in New York City last month.

In testimony against two alleged members of Nine Trey, an East Coast wing of the United Blood Nation street gang, the 23-year-old platinum-selling rapper detailed a life of “robberies, assaults [and] drugs,” leading to the conviction of the duo on racketeering conspiracy and other charges.

The eccentric rapper's testimony revealed that the same gang-world affiliation that helped boost his brand also came at a cost. Hernandez told jurors he joined the notorious gang, not only to earn credibility, but in part to aid his career in the limelight -- even confessing to paying a fellow member to shoot at a rival rapper in New York City last summer.

Shortly after the shooting, Hernandez himself was a target, getting kidnapped in Brooklyn – and escaping only after turning over hundreds of thousands of dollars worth of jewelry and claiming not to be part of Nine Trey. Hernandez testified during the trial last week that the pair of defendants were his captors. He said the two allegedly viewed him as a “poser” and not an authentic gangster. Hernandez, too, was charged with racketeering, gun and drug charges but cooperated with federal authorities.

CHICAGO JURY CONVICTS GANGBANGER WHO EXECUTED 9-YEAR-OLD IN REVENGE KILLING

Hernandez's wild story, however, is far from an isolated case, federal law enforcement officials told Fox News, noting its part of a dangerous trend in the entertainment industry.

“It is almost a pre-requisite these days to belong to a gang. It has become part of popular culture and commercialized. It’s also an important part of an artist’s public relations campaign,” said one New York-based federal agent, tasked with infiltrating gangs and arresting members. “It is basically saying that the route you need to take is to join a gang to get successful. Thirteen and 14-year-olds with impressionable minds see this happen.”

Law enforcement officials told Fox News they view the entertainment industry all too often acting as a marketing machine that glorifies gang violence and pushes it into the mainstream. The National Gang Center estimates there are around 850,000 gang members nationwide. Meanwhile, up to 80 percent of gun murders in major cities each year classified as being gang-related.

A man who calls himself Goldie Loc, left, walks with a man who calls himself Wolfe celebrating on Friday, May 1, 2015, after State's Attorney Marilyn J. Mosby announced criminal charges against all six officers suspended after Freddie Gray suffered a fatal spinal injury while in police custody in Baltimore. Loc said he is a member of the Crips gang and Wolfe said he was with the Bloods gang. (AP Photo/David Goldman)

A man who calls himself Goldie Loc, left, walks with a man who calls himself Wolfe celebrating on Friday, May 1, 2015, after State's Attorney Marilyn J. Mosby announced criminal charges against all six officers suspended after Freddie Gray suffered a fatal spinal injury while in police custody in Baltimore. Loc said he is a member of the Crips gang and Wolfe said he was with the Bloods gang. (AP Photo/David Goldman) (The Associated Press)

In the case of Hernandez, authorities said he wasn’t a Blood at the beginning of his career. But once he started to get social media attention in 2017 -- and those around him saw he could make money from a gang connection -- his fan appeal took off.

The “Dummy Boy” performer is hardly alone.

Despite denials from her spokespeople, famed female rapper Cardi B – whose name was brought into the trial by Hernandez – was characterized as a member of the Bloods. Since her rise to fame four years ago, the 26-year-old – whose real name is Belcalis Marlenis Almánzar – has curated an image largely influenced by the color red, a theme also threaded throughout her lyrics, such as“these is red bottoms, there is bloody shoes” and "Red Barz.”

NEW YORK, NEW YORK - SEPTEMBER 12: Cardi B attends Rihanna's 5th Annual Diamond Ball at Cipriani Wall Street on September 12, 2019 in New York City. (Photo by Steven Ferdman/Getty Images)

NEW YORK, NEW YORK - SEPTEMBER 12: Cardi B attends Rihanna's 5th Annual Diamond Ball at Cipriani Wall Street on September 12, 2019 in New York City. (Photo by Steven Ferdman/Getty Images)

She has also switched out “C” for “B,” illuminating keywords such as “Binderella,” and even claiming that guests to her wedding would be expected to wear her signature hue. In an interview with GQ last year, the hit rapper finally fessed up, saying she became a Blood at age 16 and had been “repping it for such a long time” despite declining participation and advising other young girls not to follow in her footsteps.

The L.A. Bloods pointed out, according to TMZ, that troubled singer Chris Brown – despite throwing up gang signs – was not an initiated member of the gang, though they were fine with him representing the brand. According to court documents obtained by Rolling Stone, Lil Wayne, Birdman and Young Thug are also members of the Bloods and were caught in the crossfire after Wayne’s tour bus was shot at by Young Thug’s tour manager in April 2015.

FILE - In this June 25, 2017, file photo, Chris Brown performs at the BET Awards at the Microsoft Theater in Los Angeles. Brown released a 45-song album "Heartbreak on a Full Moon" on Tuesday, Oct. 31. Brown has been charged with monkey-related misdemeanors. The Los Angeles city attorney's office confirms Thursday, Dec. 27, 2018, that the 29-year-old singer was charged last week with two counts stemming from his possession of a pet capuchin monkey without a permit. (Photo by Matt Sayles/Invision/AP, File)

FILE - In this June 25, 2017, file photo, Chris Brown performs at the BET Awards at the Microsoft Theater in Los Angeles. Brown released a 45-song album "Heartbreak on a Full Moon" on Tuesday, Oct. 31. Brown has been charged with monkey-related misdemeanors. The Los Angeles city attorney's office confirms Thursday, Dec. 27, 2018, that the 29-year-old singer was charged last week with two counts stemming from his possession of a pet capuchin monkey without a permit. (Photo by Matt Sayles/Invision/AP, File)

And buried below the surface of a flashy public persona, experts warn of a dark underbelly fueled by violence, crime and drugs.

GET THE FOX NEWS APP

Meanwhile, one longtime gang investigator with the Los Angeles Police Department, who requested anonymity, said up and coming artists need to understand that “talent is talent.”

NIPSEY HUSSLE REPORTEDLY KILLED OVER DISPUTE ABOUT 'SNITCHING' COURT DOCUMENTS CLAIM

“If they can make millions, they will get signed regardless of affiliation,” the source said. “Some will pay people from the neighborhood to act as their ‘security.’ The smart ones and those who are properly managed will have ex-cops to act as their security. Keeping [gang members] at an arms-length; far enough not to cause harm to them.”