A New Brunswick man is accused of setting a fire that tore through a Franklin Township apartment building, forcing multiple families from their homes and killing two pets, prosecutors said.