I don't think you'd necessarily have to know a lot about chemistry, just some observation of volcanism. The ancient Grecian knew that ground vents & volcanoes produced noxious fumes (e.g. hydrogen sulfide), and that volcanoes can explode and kill people in fairly obvious ways.
Not to say you could have figured out the carbon dioxide part, but you could have developed an understanding deeper than "god" or "spirits".