Nobody was hurt, and members of the Islamic Centre of Escondido were able to extinguish the small blaze before firefighters around 3.15am.
The incident was being investigated as arson and a possible hate crime, said police in the city about 48 kilometres north of downtown San Diego.
A note was found in the parking lot referencing the shootings this month that killed 50 people at mosques in Christchurch, New Zealand, police lieutenant Chris Lick said. He did not elaborate about the contents of the note.
Investigators did not release information about a suspect.
The fire caused minor damage to the building's exterior.
Seven people were inside the mosque at the time of the fire, police told the KNSD TV station. They were able to put out the fire with a fire extinguisher before firefighters arrived on the scene, KNSD reported.
"There are people who sleep there overnight,'' member Yusef Miller said. "They heard the sounds, they smelled some funny smells, and there was a letter saying something connecting to New Zealand at the same time. So, this made everybody especially on edge.''
The Escondido mosque was created four years ago and serves several hundred people in the city of about 143,000 residents, Miller said.
He told KNSD that worshippers are undeterred.
"We won't stop praying,'' Miller said. "We won't stop gathering.''