The small fire was reported after 10:30 pm on 19th Street between Martin Luther King Jr. Way and K Street.
Merced police say Thomas Housley lit paper on fire and poured gasoline over it in an attempt to burn down the building.
Investigators believe Housley set the fire after a dispute with other tenants in the building about missing mail.
One of the residents put out the fire before police arrived, and no one was hurt.
Officers arrested Housley at the scene. He was booked into the Merced County Jail for attempted arson.