Moments before she was shot dead in her Subaru Outback, 66-year-old dog sitter Judy Salamon had been recording a group of young men she thought were burglarizing homes several blocks from where she lived in Oakland’s Maxwell Park neighborhood, investigators say.

Three years later, some of the same themes surrounding the slaying — the brutality of street crime, the desire to protect one’s community and the danger of getting involved— are playing out in an Alameda County courtroom where two men are on trial for murdering Salamon and stealing her phone, and where numerous witnesses have been reluctant to take the stand.

The July 2013 attack on Salamon prompted an outcry from Oakland residents fed up with killings, including one the prior week of an 8-year-old girl at a sleepover. Oakland Mayor Libby Schaaf, then a councilwoman, said at the time, “Oaklanders cannot live like this.” Now, the trial is showing just how difficult it is to solve and prosecute homicide cases when some witnesses would rather be jailed than tell what they know.

Lawyers for defendants Stephon Lee, a 25-year-old Richmond resident, and Mario Floyd, a 24-year-old Oakland resident, say many of the witnesses to the shooting are untrustworthy, unreliable and inconsistent. Floyd’s attorney, Anne Beles, called the trial “a mess.”

But Deputy District Attorney Butch Ford said the case is solid and that he wasn’t surprised that witnesses — fearful of the defendants and their association with a neighborhood gang — would backpedal on statements they gave to him and police as soon as they came face to face with Floyd and Lee in the courtroom.

“It’s the snitch culture,” Ford said outside court. “If you talk to the police, it’s considered a violation of the code. They have to go back out there as soon as they’re done in here.”

According to prosecutors, Floyd and Lee, who goes by the street name “Feenie,” were upset on the afternoon of July 24, 2013, believing that Salamon had been following them and filming them with her phone.

Floyd got out of a car on Fern Street near Fairfax Avenue, argued with Salamon and threw a trash bin at her, Ford said. Lee then allegedly fired three shots from a Glock pistol, one of which struck Salamon in the head, and got into the passenger’s seat of the men’s car. Salamon’s car rolled backward and crashed into a parked vehicle.

The suspects made a U-turn at the top of a hill, prosecutors said, and returned to Salamon, who investigators believe was still alive and may have struggled with Floyd as he allegedly stole her phone. Floyd’s DNA was found on the victim’s fingernails, Ford said.

Police seized Lee’s phone and discovered a pair of photos in it that appeared to show Salamon’s phone reflecting Lee’s face, Ford said. The photos may have been taken as Lee tried to sell the device, Ford added.

Though authorities don’t believe Floyd was the shooter, jurors could hold him responsible for Salamon’s slaying under California’s felony-murder rule, which allows people who didn’t kill anyone to be charged with murder if they participated in a crime that led to a death — in this case, the alleged robbery of Salamon’s phone.

But the case has been complicated by some witnesses openly acknowledging they are trying to protect Floyd. Carmelita Jordan, a friend of Floyd’s, testified last week that she didn’t want him to go to jail. She was on the street when the shooting happened and jumped into her car’s trunk when shots were fired.

“I don’t want to be here. You told me I’d be helping Mario, not hurting him,” she told Ford from the witness stand.

Jordan, along with a then-17-year-old boy who was allegedly in the backseat of the car with the suspects, had to be jailed on material-witness warrants after they refused to come to court.

Another witness, a boy who was 11 when the shooting happened and whose guardian is the grandmother of Floyd’s children, was allegedly choked by Lee as the two defendants threatened to shoot him if he talked to police. When he was called to testify in a preliminary hearing, the boy refused to take the oath to tell the truth more than a dozen times, eventually consenting with, “Oh, my gosh, I guess so,” according to a court transcript.

Another witness, Lana Taki, who was associated with some of Floyd’s family members and was pregnant at the time, was jumped by a group of women who accused her of being a snitch, Ford said. A man joined in the beating, and the group stole her car. Taki was subpoenaed to testify in the trial but never showed up.

Inconsistencies within witness testimony and between witnesses are key to the defense’s case. Ford, meanwhile, has countered that initial statements to police should be given more weight than what’s said in court.

Former San Francisco gang and homicide prosecutor Tony Brass said jurors are usually perceptive about whether witnesses are lying.

“The idea of giving weight to an earlier statement begins and ends with, ‘Is this person telling me the truth right now?’” Brass said. “If the suspicion is they’re backpedaling because they’re afraid, that tells the juror all they need to know about why this person is lying on the stand.”

Brass said witnesses to gang violence have “legitimate fear” about testifying. “One of the difficulties with gang cases is that gang members have associates on the outside — always,” he said.

The murder trial, which will continue for the next two weeks in Superior Court Judge Kevin Murphy’s courtroom, is also the first major test over whether a misconduct controversy surrounding Oakland police Sgt. Mike Gantt will affect three pending homicide cases.

Gantt, the lead detective in Salamon’s death, had his girlfriend transcribe recordings of his interviews, according to correspondences between attorneys in the case. Gantt was placed on leave and later cleared of criminal wrongdoing.

In court papers, Beles sought to compel the district attorney to turn over details about the misconduct investigation, but the judge denied her request. She said Monday that she did not plan to call Gantt to testify.

Ford credited Gantt with solving the murder case through “incredible patience and passion for the job.”

A close friend of Salamon’s who has been watching the trial — and gave only his first name, Eric, out of fear of retaliation — said he was confident that the volume of witnesses would bring justice for Salamon, an anti-crime activist born in Hungary to Holocaust survivors.

“It’s a tragedy for all involved, for all of Judy’s friends and family,” Eric said. “It’s a tragedy for the witnesses because they have to deal with gang pressure, and it’s a tragedy for the suspects because I don’t think they planned to go out and murder someone that day.”

Kimberly Veklerov is a San Francisco Chronicle staff writer. Email: kveklerov@sfchronicle.com Twitter: @kveklerov