Effects of non-antibiotic pharmaceuticals on antibiotic resistance genes (ARGs) in soil ecosystem are still unclear. In this study, we explored the microbial community and ARGs variations in the gut of the model soil collembolan Folsomia candida following soil antiepileptic drug carbamazepine (CBZ) contamination, while comparing with antibiotic erythromycin (ETM) exposure. Results showed that, CBZ and ETM all significantly influenced ARGs diversity and composition in the soil and collembolan gut, increasing the relative abundance of ARGs. However, unlike ETM, which influences ARGs via bacterial communities, exposure to CBZ may have primarily facilitated enrichment of ARGs in gut through mobile genetic elements (MGEs). Although soil CBZ contamination did not pose an effect on the gut fungal community of collembolans, it increased the relative abundance of animal fungal pathogens contained therein. Soil ETM and CBZ exposure both significantly increased the relative abundance of Gammaproteobacteria in the collembolan gut, which may be used to indicate soil contamination. Together, our results provide a fresh perspective for the potential drivers of non-antibiotic drugs on ARG changes based on the actual soil environment, revealing the potential ecological risk of CBZ on soil ecosystems involving ARGs dissemination and pathogens enrichment.