We show that families of nonlinear gravity theories formulated in a metric-affine approach and coupled to a nonlinear theory of electrodynamics can be mapped into general relativity (GR) coupled to another nonlinear theory of electrodynamics. This allows to generate solutions of the former from those of the latter using purely algebraic transformations. This correspondence is explicitly illustrated with the Eddington-inspired Born-Infeld theory of gravity, for which we consider a family of nonlinear electrodynamics and show that, under the map, preserve their algebraic structure. For the particular case of Maxwell electrodynamics coupled to Born-Infeld gravity we find, via this correspondence, a Born-Infeld-type nonlinear electrodynamics on the GR side. Solving the spherically symmetric electrovacuum case for the latter, we show how the map provides directly the right solutions for the former. This procedure opens a new door to explore astrophysical and cosmological scenarios in nonlinear gravity theories by exploiting the full power of the analytical and numerical methods developed within the framework of GR.