New Mexico was named such before Mexico was named. The Spaniards named a much larger territory that encompassed all of the current state of New Mexico, New Mexico. A couple centuries later the Mexican people revolted and gained their independence, and named the country Mexico in 1821