Born in Rożyszki (modern Rozsishky) near Uman' in Bracław Voivodship, Gonta served as a sotnik (captain) of Cossack household militia of Franciszek Salezy Potocki, the Voivode of Kiev, and commanded a small unit in the garrison of Uman since 1757. During the Koliivshchyna he was ordered to fight the approaching haidamaka forces of Maksym Zalizniak. Instead, he and his militia joined the rebels, and the joint forces captured and ravaged the town of Uman on June 21, 1768. In what became known as the Massacre of Uman, thousands of local Polish szlachta, Jews, Uniates and other people were slaughtered. After that, Gonta was proclaimed colonel and commanded the garrison of Uman.