With the Mexican–American War already underway, Wilcox joined the 4th Infantry in the Mexican city of Monterrey in 1847. He was appointed as an aide to Maj. Gen. John A. Quitman, acting as his adjutant at the Battle of Veracruz and the Battle of Cerro Gordo. For gallant conduct at the Battle of Chapultepec, in action at the Belén Gate, and the Battle for Mexico City, Wilcox was appointed a brevet first lieutenant on September 13.