Gest was elected as a Republican to the Fiftieth and Fifty-first Congresses (March 4, 1887 – March 3, 1891).
He was an unsuccessful candidate for reelection in 1890 to the Fifty-second Congress.
Circuit judge of the fourteenth judicial district of Illinois from June 1897 until his death in Rock Island, Illinois, August 9, 1912.
He was interred in Chippiannock Cemetery.