1670s, past participle adjective from contest (v.). Of elections, from 1771, American English.
c.1600, from French contester "dispute, oppose," from Middle French, from Latin contestari (litem) "to call to witness, bring action," from com- "together" (see com-) + testari "to bear witness," from testis "a witness," (see testament). Calling witnesses as the first step in a legal combat. Related: Contestable; contested; contesting.
1640s, from contest (v.).