Because it used to be part of Mexico, along with many other states in the U.S., so now it is called New Mexico. Yes, like all of the U.S. Southwest and Texas, New Mexico was part of Mexico until...
They share a common border.
Mexico lost half its territory, including New Mexico, at the Mexican-American War of 1846-1848.
Mexico is a soverign nation that borders the United States of America. New Mexico is a state within the United States of America.
Oregon. New Mexico was part of Mexico until 1848 and Idaho was part of Oregon until 1846.