Andrew Barrientos, 20, of Union City, has been charged with 13 felony counts, including attempted murder, for the Aug. 27 shooting.
The first witness to testify was Dave Ferreira, whom prosecutors say Barrientos tried to carjack after Young was shot.
Ferreira said he was shopping at a convenience store at the corner of 86th and Bancroft avenues when he heard a series of pops that he initially thought was firecrackers.
He said he then saw a man, whom he later identified as Barrientos, running toward his car with a gun.
Ferreira said he jumped in his car and tried to drive away but Barrientos opened fire, shattering his front window.
He only suffered minor wounds to his face, but he said he initially thought that Barrientos "wanted to kill me."
"I was just praying I wasn't a dead man," Ferreira said.
Ferreira said he noticed that Barrientos was wearing a red belt that he recognized as being associated with the Nortenos gang. He said he's familiar with gangs in Oakland because he's worked in the inner city in Oakland for 13 years.
Ferreira said he didn't realize that Barrientos had wanted to carjack his vehicle until after Barrientos fired shots.
"I had no idea he wanted my car," Ferreira said. "If I'd known that I would have let him have it."
Barrientos is accused of shooting Young, 39, when he and another officer tried to arrest him at 2009 Auseon Ave., near Bancroft Avenue, in East Oakland at about 2:30 p.m. on Aug. 27.
The two officers were working in Oakland as part of the Southern Alameda County Major Crimes Task Force and had a warrant for Barrientos' arrest for an incident in April as well as for allegedly threatening his ex-girlfriend with a gun in San Leandro on Aug. 13.
In addition to attempted murder, Barrientos is charged with carjacking, attempted carjacking and two counts each of shooting at an occupied vehicle, carrying a concealed firearm and carrying a loaded firearm in a city.
Young spent more than seven weeks at Highland Hospital in Oakland but was finally allowed to return home to his wife and two children last week.
Fremont police spokesman Detective Bill Veteran says Young faces a long recovery process but hopes to eventually return to work.