James Ronald Lee III pulled his cherry red Volkswagen up to a pair of detectives from the Los Angeles Police Department in a parking lot in South Los Angeles. The detectives pulled a handgun, a rifle and a sock stuffed with ammunition from the trunk.

Mr. Lee had kept the guns in a liquor store he once owned and did not have a use for them anymore. “I don’t want them around my house, because anything could happen,” he said. Mr. Lee received a $100 Target gift card for each weapon.

He was part of a one-day gun buyback organized by Mayor Eric Garcetti’s Office of Gang Reduction and Youth Development. That day in May, the police collected 772 guns in a program financed in part by a nonprofit called Gun by Gun that uses crowdfunding to help take guns off the streets.

Gun by Gun is the brainchild of Ian Johnstone, a tech entrepreneur, and Eric King, an expert on innovation. The two friends use contemporary technology and financing to address the vexing problem of gun violence. Since its founding in 2013, Gun by Gun donors have given a total of $100,000 toward the purchase and destruction of 1,100 weapons.