I learned that día and dios are related while looking into the topic of masculine nouns that end in -a. Día is the most common of these words — we use it every day in Buenos días (note the masculine buenos).
To find the relationship between día and dios you have to go back to Proto-Indo-European (PIE), the language that was the ancestor of Latin, and hundreds of other languages from Gaelic to Gujarati. Día comes from Latin diēs, which is in turn derived from PIE *diéus, meaning ‘Sky-god’ or ‘daytime sky’. Dios comes from Latin deus, from PIE *deiuós ‘God’. These PIE roots are related to many familiar words. *Diéus is the root of both Zeus and Jupiter (the first syllable is the related bit). English words related to *deiuós include demon (that’s ironic), diva, and Tuesday.
The connection between the two PIE roots, *diéus and *deiuós, is too technical for me to really understand because I’m not an PIE expert. However, I know such an expert, Cornell linguistics professor Michael Weiss. He explained to me that *deiuós ‘god’ was derived from the word for ‘sky’ via a common PIE process of vowel affixation referred to by its Sanskrit name, vr̥ddhi. (This is a simplification of his explanation, and I hope I got it right.) As Professor Weiss is the author of the formidable Outline of the Historical and Comparative Grammar of Latin I am more than happy to take his word for it.
Incidentally, the fact that día comes from the name of the sky god — a masculine deity — explains its masculine gender. Its -a ending is another story, hopefully one I’ll have time to tell soon.