Both controller and comptroller are of French origin, from the 13th century, and refer to a person keeping a duplicate register as a check on a treasurer or keeper of accounts It would appear from references that controller slightly predates comptroller (at least that seems to be the case in English).
It would also seem that the verb control may be a back-formation from controller. The more usual senses of control, with a life in English from the late 15th century, do not appear in French (from English) until the late 19th century.
The OED notes that: in later use, the retention of comptroller over controller in specific official titles was probably partly due to a desire to dissociate the title semantically from control
a1400 Langland Piers Plowman (Corpus Cambr.) C. xii. l. 298
Counteroller [c1400 Huntington HM 137 Selde..falleþ þe seruant so
deepe in arrirages As doþ þe reyue oþer þe conterroller þat rekene mot
and a-counte; c1400 Trin. Cambr. countrollour, ?a1450 Laud
1433 Rolls of Parl.: Henry VI (Electronic ed.) Parl. July 1433 §18.
m. 15, Or any other greet officier of household, as steward,
chamberlein, tresorer or compterolleur.
a1475 Bk. Curtasye (Sloane 1986) l. 550 in Babees Bk. (2002) i. 317
Þer-fore þo countrollour..Wrytes vp þo somme as euery day.
1653 tr. L. van Aitzema Notable Revol. Netherlands 599 First and
presiding Counsellor and Controller in the Chamber of Accounts.
1719 G. Jacob Lex Constitutionis xii. 309 There are three
Controllers.., viz. of the Treasury Accompts, Victuallers Accompts,
and Store-keepers Accompts. (OED)