Gilmartin elected to succeed Thompson as president of the ICSA
He won by a margin of just six votes over the only other candidate, Martin Coughlan, a beef farmer from Carrick-on-Suir, Co Waterford.
The keenly contested election took place at a meeting of the ICSA national executive in Portlaoise.