NEW YORK (CBSNewYork/AP) — A mobster involved in a legendary heist retold in the film “Goodfellas” told a jury Wednesday that he became an informant because he was broke.

Gaspare Valenti testified in Manhattan U.S. District Court Wednesday that he approached the FBI in 2008, and was paid to wear a wire and record conversations with Vincent Asaro.

READ MORE: Alvin Ailey American Dance Theater Returns With 3-Week Homecoming Season

Asaro is on trial in the $6 million Lufthansa robbery at John F. Kennedy International Airport in 1978.

Valenti, 68, testified he had a gambling problem that put him in deep debt. He said his money issues angered Asaro, 80 — his cousin and former captain in the Bonanno organized crime family.

Asaro, who has a history of convictions for lesser mob-related crimes, was arrested again after Valenti came forward with new information about the heist and agreed to wear a wire to try to coax admissions out of the reputed longtime member of the Bonanno crime family.

The defense said Valenti and others are framing Asaro to save themselves from prison terms.

Other witnesses at trial were to include former Bonanno boss Joseph Massino, the highest-ranking mobster to ever break the mob’s oath of omerta by becoming a government witness.

Asaro was a Bonanno soldier, with the Mafia slogan “death before dishonor” tattooed on his forearm, in late 1978 when hooded gunmen looted a vault in the Lufthansa’s cargo terminal and stole about $5 million in untraceable U.S. currency that was being returned to the United States from Germany, along with about $1 million in jewelry.

The theft was orchestrated by James “Jimmy the Gent” Burke — a late Lucchese crime family associate portrayed by Robert De Niro in “Goodfellas” — with the blessing of Asaro, whose crime family considered the airport its turf, court papers said.

Afterward, higher ranking conspirators were expected to receive $750,000, “but most did not live to receive their share, either because they were killed or it was never given to them,” the papers said.

In one of the recordings made by Valenti, Asaro complained in a profanity-laced rant, “We never got our right money, what we were supposed to get…. Jimmy kept everything.”

READ MORE: Toys 'R' Us Opening Flagship Store Inside American Dream Mall

But prosecutors claim Asaro indeed got his money, and blew most of it at the racetrack because of a gambling problem, prosecutors said.

The windfall set the stage for a bloodbath portrayed in “Goodfellas.” De Niro’s character became irate over fellow mobsters’ purchases of flashy cars and furs, fearing they would attract law enforcement attention, and had some of them whacked — a plot twist based on the inside account of Henry Hill, the mob associate-turned informant played in the film by Ray Liotta.

In addition to the real-life heist, Asaro is charged in the 1969 murder of a suspected law enforcement informant, Paul Katz, whose remains were found during an FBI dig in 2013 at a house once occupied by Burke. Asaro told the cooperator that Burke “had killed Katz with a dog chain because they believed he was a ‘rat,”’ the court papers said.

Valenti, 68, also told investigators that Asaro and Burke brought Katz’s body to a vacant home in Queens where it was concealed beneath a cement floor, the paper said. In the 1980s, at the behest of the imprisoned Burke, Asaro ordered the cooperator to dig up the remains, “a human skull, bones and some corduroy clothing material,” and move them to another location, the papers said.

In the years since the heist and the murder, the Martin Scorsese blockbuster was made, books were written and some of the robbers were convicted or rubbed out. Asaro quietly went about his business and, for a time, got away with it, though his criminal career and personal life were rocky, authorities said.

In the 1990s, the then-captain in the Bonanno family was demoted to soldier because of “his gambling problems and failure to repay debts to those associated with organized crime,” court papers said. Prosecutors say at one point, he found himself a subordinate of his mobster son, who rose through the ranks with his help, a favor his father regretted.

“Jerry’s for Jerry,” Asaro said on one of the tapes. “I lost my son. I lost my son when I made him a skipper. I lost my son when I put him there.”

By 2013, “after a series of high-profile Bonanno family members cooperated with law enforcement or were incarcerated,” the defendant had been promoted again to captain and won a position on the “panel” or administration running the Bonanno family, court papers said. But by then, the cooperator had come forward to crack open the Lufthansa time capsule and the feds were closing in.

“Sometimes mob secrets never get told,” said Jerry Capeci, a Mafia expert who writes the web column. “And sometimes they get told a lifetime later.”

MORE NEWS: Student Caught With Gun, Thousands Of Dollars Cash At Brooklyn School

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)