Mr Gaetz is leading Republican opposition to Mr McCarthy, who currently leads the House Republican conference.
On Thursday, as the House made a seventh attempt to nominate a speaker, Mr Gaetz cast a vote in favour of the former president.
Hours later, Mr Trump took to his Twitter-like social media platform Truth Social and posted a picture mocking Mr Gaetz.
The picture showed president Joe Biden speaking while vice president Kamala Harris and Mr Trump sit behind him.
Mr Trump is seen on the speaker’s chair with his tongue out.
The photo was later shared on Twitter by several commentators.
Earlier, Mr Trump’s spokesperson Liz Harrington had retweeted a video of Mr Gaetz’s vote.
Mr Gaetz has consistently suggested names other than Mr McCarthy’s for the speaker’s post ever since the vote has taken place.
On Monday, he delivered a speech to nominate representative Jim Jordan right after Mr Jordan, who is set to become the chairman of the House Judiciary Committee, gave a speech to nominate Mr McCarthy.
Through the week, he was also seen chatting up many lawmakers on the floor, including Democrats like Alexandria Ocasio-Cortez.
Republican hardliners have persistently criticised Mr McCarthy’s bid to become House speaker ever since the GOP won the House majority in the November midterms.
Mr Gaetz has also written to the Architect of the US Capitol Brett Blanton and accused Mr McCarthy of being a “squatter”.
Meanwhile, Mr Trump has urged Republicans to vote for Mr McCarthy and said the GOP’s continued infighting over electing the next House speaker is only serving to make the role “bigger and more important”.
In a post on his Truth Social platform on Thursday morning, Mr Trump said: “A big Republican VICTORY today, after going through numerous Roll Calls that failed to produce a Speaker of the House, has made the position & process of getting to be Speaker BIGGER & MORE IMPORTANT than if it were done in the more traditional way.”
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies