He was a member of the Michigan House of Representatives in 1903. In 1904, Denby was elected as a Republican from Michigan's 1st congressional district to the 59th, 60th and 61st Congresses, serving from March 4, 1905, to March 3, 1911. Denby served as chairman of the United States House Committee on Naval Affairs. He was defeated in 1910 general election by Democrat Frank E. Doremus and resumed his law practice in Detroit. He served as president of the Detroit Board of Commerce in 1916, and in 1917 enlisted as a private in the United States Marine Corps when the U.S. entered World War I. He was discharged in 1919 with the rank of major. When Warren G. Harding became President in March 1921, he appointed Denby Secretary of the Navy. During the crisis of mail robberies in 1921, Denby issued orders that Marines should be put in mail trucks and rail cars as protectors of the U.S. Mails. In his stirring order "To the Men of the Mail Guard", Denby impressed upon his former service the importance of the high duty entrusted to them: "If two Marines are covered by a robber, neither must put up his hands, but both must immediately go for their guns. One may die, but the other will get the robber, and the mail will get through. When our Corps goes in as guards over the mail, that mail must be delivered, or there must be a Marine dead at the post of duty. There can be no compromise..." Within days, the robberies stopped, and there was not a single delivery of the mails disrupted while Marines stood the watch.
Shortly afterwards, Denby got Harding's approval to transfer control of the naval oil reserves at Teapot Dome, Wyoming, and Elk Hills, California, from the Department of the Navy to the Department of the Interior, headed by Albert B. Fall. Fall proceeded to lease these oil fields to friends who were heads of oil companies in exchange for over $400,000 in personal loans. Despite attempts to keep the deal secret, the Wall Street Journal leaked news of the leasing, and the Senate decided to launch an inquiry into the matter. The investigation began in October 1923 after Harding's death, and the Senate Committee on Lands and Public Surveys, which carried out the inquiry, concluded in 1924 that the Teapot Dome and Elk Hills leases to the oil companies had been fraudulent and corrupt. Both Denby and Fall were forced to resign from office as a result; however, it is apparent that President Harding did not have an active role in the wrongdoing.
Death
Following his resignation, Denby went back to practicing law in Detroit, where he died several weeks before his 59th birthday. Detroit's Edwin C. Denby High School is named in his honor, as is the Denby Center for Children and Family Services, which the Salvation Army opened in Detroit in 1930 to provide housing and treatment for abused and neglected children.