The temple, dedicated to the rain god Tlaloc, was unearthed by archaeologists using radar technology.
It is located deep within the Teopanzolco pyramid in the city of Cuernavaca in Morelos state.
Experts from the National Institute of Anthropology and History (INAH) in Mexico say the structure probably dates back to around 1150.
The site was used by the Tlahuica people who lived in Morelos.
A ceramic remains and an incense burner belonging to the culture were also found.
Experts say the temple would have been around six metres long and four metres wide.
Barbara Koniecza, of the INAH, said: “The pyramid suffered considerable rearrangement of the core of its structure.”
She added: “The floor of both shrines sank and bent, which also put their stability in danger.”
The 7.1-magnitude earthquake struck central Mexico on 19 September 2017 and killed 369 people, mostly in the capital Mexico City.