By performing accurate ab-initio density functional theory calculations, we study the role of $4f$ electrons in stabilizing the magnetic-field-induced ferroelectric state of DyFeO$_{3}$. We confirm that the ferroelectric polarization is driven by an exchange-strictive mechanism, working between adjacent spin-polarized Fe and Dy layers, as suggested by Y. Tokunaga [Phys. Rev. Lett, textbf{101}, 097205 (2008)]. A careful electronic structure analysis suggests that coupling between Dy and Fe spin sublattices is mediated by Dy-$d$ and O-$2p$ hybridization. Our results are robust with respect to the different computational schemes used for $d$ and $f$ localized states, such as the DFT+$U$ method, the Heyd-Scuseria-Ernzerhof (HSE) hybrid functional and the GW approach. Our findings indicate that the interaction between the $f$ and $d$ sublattice might be used to tailor ferroelectric and magnetic properties of multiferroic compounds.