Great question! Save for the oral echo, there's no necessary relationship between gerontology and ontology. The t comes from the genitive case.
Here is the Ancient Greek Wiktionary entry for γέρων (geron). Note that, unlike English, Greek has several noun cases, including the genitive γέροντος (gerontos), the dative γέροντῐ (geronti), and the accusative γέροντα (geronta).
Now, think about the meaning of gerontology you suggested. It is the study of old men. In another language, old men might be in the genitive or dative, indicating some relation to the head noun. The root being adapted into English may come from this form. So in that case we would have geront- plus logos, which after adjusting each to fit English paradigms for Greek roots (logos to -logy with -o- as a combining vowel, gerontos or geronti to geront-) results in gerontology.
Odontology behaves in a similar way, with the root being ὀδούς (odous) but changing in the genitive form to ὀδόντος (odontos). (See also orthodontics and other toothy variants.)
More generally, these are examples of classical compounds.