Lying about his age, Zalinski enlisted in the United States Army, and served during the American Civil War as aide-de-camp on the staff of General Nelson A. Miles from October 1864. In February 1865, he was commissioned a second lieutenant in the Second New York Heavy Artillery Regiment, having been recommended for promotion for gallant and meritorious conduct at the Battle of Hatcher's Run, Virginia. He continued on General Miles's staff until the surrender of General Robert E. Lee in April 1865.