Gwyn was wounded at the Battle of the Wilderness in 1864, but returned to service after recuperating to take command of the Third, and eventually the First and Second Brigades of the First Division of the Union Army's V Corps. Gwyn was brevetted as a brigadier general by President Abraham Lincoln and then as a major general by President Andrew Johnson for his service. His men described him as "a handsome and accomplished officer, and a bold and aggressive leader".Smith (1892), p. 639 After the war, Gwyn returned to Philadelphia, although later moving to New York, and resumed his business dealings. He died on July 17, 1906, and was honored with a military funeral and buried in Woodlands Cemetery, Philadelphia.
