Transport coefficients associated with the mass flux of impurities immersed in a moderately dense granular gas of hard disks or spheres described by the inelastic Enskog equation are obtained by means of the Chapman-Enskog expansion. The transport coefficients are determined as the solutions of a set of coupled linear integral equations recently derived for polydisperse granular mixtures [V. Garzo, J. W. Dufty and C. M. Hrenya, Phys. Rev. E {bf 76}, 031304 (2007)]. With the objective of obtaining theoretical expressions for the transport coefficients that are sufficiently accurate for highly inelastic collisions, we solve the above integral equations by using the second Sonine approximation. As a complementary route, we numerically solve by means of the direct simulation Monte Carlo method (DSMC) the inelastic Enskog equation to get the kinetic diffusion coefficient $D_0$ for two and three dimensions. We have observed in all our simulations that the disagreement, for arbitrarily large inelasticity, in the values of both solutions (DSMC and second Sonine approximation) is less than 4%. Moreover, we show that the second Sonine approximation to $D_0$ yields a dramatic improvement (up to 50%) over the first Sonine approximation for impurity particles lighter than the surrounding gas and in the range of large inelasticity. The results reported in this paper are of direct application in important problems in granular flows, such as segregation driven by gravity and a thermal gradient. We analyze here the segregation criteria that result from our theoretical expressions of the transport coefficients.