He was a member of the New York State Senate (16th D.) from 1909 to 1918, sitting in the 132nd, 133rd, 134th, 135th, 136th, 137th, 138th, 139th, 140th and 141st New York State Legislatures. He was President pro tempore of the New York State Senate from 1911 to 1914, and became Acting Lieutenant Governor of New York after the impeachment of Governor William Sulzer, and the succession of Lieutenant Governor Martin H. Glynn to the governorship. In 1914, while Wagner remained President pro tempore, John F. Murtaugh was chosen Majority Leader of the State Senate. That was the only time before 2009 that the two offices were not held by the same person. After the Democrats lost their Senate majority, Wagner was Senate Minority Leader from January 1915 until he retired in 1918.