 After Dorchester was annexed to the city of Boston on January 4, 1870, Pierce became a member of the Boston Board of Aldermen and was nominated and elected Mayor of Boston for 1873.Pierce was elected as a Republican to the Forty-third Congress to fill the vacancy caused by the death of William Whiting.He was reelected to the Forty-fourth Congress and overall served from December 1, 1873, to March 3, 1877.