Transposable elements are common targets for transcriptional and post-transcriptional gene silencing in eukaryotic genomes. However, the molecular mechanisms responsible for sensing such repeated sequences in the genome remain largely unknown. Here, we show that machinery of homologous recombination (HR) and RNA silencing play cooperative roles in copy number-dependent de novo DNA methylation of the retrotransposon MAGGY in the fungus Pyricularia oryzae. Genetic and physical interaction studies revealed that RecA domain-containing proteins, including P. oryzae homologs of Rad51, Rad55, and Rad57, together with an uncharacterized protein, Ddnm1, form complex(es) and mediate either the overall level or the copy number-dependence of de novo MAGGY DNA methylation, likely in conjunction with DNA repair. Interestingly, P. oryzae mutants of specific RNA silencing components (MoDCL1 and MoAGO2) were impaired in copy number-dependence of MAGGY methylation. Co-immunoprecipitation of MoAGO2 and HR components suggested a physical interaction between the HR and RNA silencing machinery in the process.