On March 20, 1847, Hotaling enlisted in the NY militia as a dragoon, with the intention of serving in the Mexican–American War. Hotaling landed in Veracruz as part of the army that was under the command of General Winfield Scott, and fought his way inland toward Mexico City. During guerrilla action in the Battle for Mexico City, he was severely wounded by a slash to the throat and would have died, were it not for the medical attention of a fellow soldier. On July 21, 1848, Hotaling was discharged due to the end of the war.