Abraham Martinez, 22, was brought to the San Francisco courtroom by U.S. marshals. He is awaiting sentencing on federal gang-related charges.
"He has intimate inside knowledge of the MS-13 gang and there is an allegation against Mr. Ramos that he was a member of that gang," assistant district attorney Omid Talai said.
Abraham Martinez, 22, says Ramos was a known member of the 20th Street Clique, faction of the violent MS-13 gang.
Martinez, who goes by the gang nickname Goofy, told the jury Ramos even helped initiate him in 2000 by being "jumped in," or beaten up by fellow gang members.
Martinez was not in the car in 2008 when Ramos is said to have shot to death Tony Bologna and his two sons. The Bologna's were in their Honda Civic when police say Ramos drove next to them and fired the fatal shots.
Martinez's role as a witness is to convince the jury that Ramos was an active gang member, a position the defense vehemently denies.
"We admitted he was a gang member; he is not a gang member and he hasn't been a gang member for a number of years," defense attorney Marla Zamora said.
Martinez said Ramos' nickname was Popeye and that they would be "putting in work," in gang parlance, hunting for their hated rivals, the Nortenos.
Prosecutors contend that Ramos shot the Bolognas after mistaking them for Nortenos.
In 2006, Martinez was shot and wounded by police after a frantic car chase that ended up with multiple crashes on Treasure Island. Three years ago, he pleaded guilty in federal court to gang racketeering charges and using a firearm.
He testified against reputed MS-13 gang members arrested in a huge federal crackdown, which resulted in more than two dozen indictments.
Ramos' lawyer questions Martinez's credibility, given his long criminal record.
"I don't want to comment on any evidence, but a rat is a rat, that's all I can say," Zamora said.