Gods are imaginary until there is some valid evidence that they exist.Imaginary things are by definition not real (dictionary.com if you're wondering, jetson.) Are you trying to imply that things magically become real when we find evidence of them?
Imaginary things are not real in that they only exist in the imagination. They do not exist in reality. That is what "not real" means. There is nothing actually there, instead of something.
For example, before computers were invented, people wrote science fiction stories about powerful electronic brains with all this information stored in them.
They were not real, only existed as ideas in the stories, and there was no evidence of their existence.
But when people invented computers and built them for real, they were no longer imaginary. There is now evidence of their existence, so you could say that yes, they magically became real. (If by magic you mean people and their ability to create stuff.) When people invent or discover something, and there is evidence of that something, it becomes real.
Now you may want to complicate this discussion by asking if microscopic organisms were real before people had the instruments to detect them. Of course they were real, because they had real effects in the world. People got sick from them, were able to use them to make cheese, wine, and bread, saw that food spoiled because of them, etc. There was evidence for their existence.
Same thing with distant planets, dark matter, gravity, etc. They all have real effects in the world even though people have not always had the instruments to detect them or the knowledge to explain them.
When people use their incomplete knowledge to explain things, like thinking thunder is the sound of gods fighting, or believing that witches cast spells to make people sick, that may be the best explanation at the time. When you get a better explanation, you can discard the other ones. We no longer need ghosts, witches, gods or other mysterious beings to explain why people win the lottery, get malaria, survive an accident or have nightmares.
Some people have a very hard time discarding gods, even though they have no observable effect on the world, and we have much better explanations for just about everything gods are supposed to do.