He served in the Union Army during the Civil War, and commanded the 109th New York Infantry Regiment. At the Battle of the Wilderness in May, 1864, he was able to rally his men and hold the Union line. For his actions he subsequently was awarded the Medal of Honor. His citation reads: Tracy "seized the colors and led the regiment when other regiments had retired and then reformed his line and held it." Later that year, he became commandant of the Elmira prisoner of war camp, before being appointed Colonel of the 127th Infantry, U.S. Colored Troops, on August 23, 1864. Tracy was discharged from the volunteer service on June 13, 1865. On January 18, 1867, President Andrew Johnson nominated Tracy for appointment to the brevet grade of brigadier general of volunteers, to rank from March 13, 1865, and the U.S. Senate confirmed the appointment on February 21, 1867.