Dunlap was elected as a Unionist to the Thirty-seventh Congress (March 4, 1861 – March 3, 1863). He served as chairman of the Committee on Expenditures in the Department of the Navy (Thirty-seventh Congress).
He served as member of the Border State Convention in 1861.
He was one of the managers appointed by the House of Representatives in 1862 to conduct the impeachment proceedings against West H. Humphreys, United States judge for the several districts of Tennessee.