Allaah says (interpretation of the meaning):
“And when the wild beasts shall be gathered together”
[al-Takweer 81:5]
“There is not a moving (living) creature on earth, nor a bird that flies with its two wings, but are communities like you. We have neglected nothing in the Book, then unto their Lord they (all) shall be gathered”
[al-An’aam 6:38]
Ibn ‘Abbaas said: “Everything will be gathered, even the flies.”
On the Day of Resurrection, the animals will settle scores between one another. It says in a hadeeth of Abu Hurayrah that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “All scores will be settled on the Day of Resurrection; even the hornless sheep will settle its scores with the horned sheep.” (Narrated by Muslim, al-Birr wa’l-Silah wa’l-Adaab, 4679).
Source: https://islamqa.info/en/answers/11437/what-is-the-fate-of-animals-in-the-day-of-resurrection