Aims. During the first 40 s after their birth, proto-neutron stars are expected to be subject to at least two types of instability. The first one, the convective instability, is excited in the inner regions, where the entropy gradient produces a Rayleigh-type convection. The second one, the neutron-finger instability, is instead excited in the outer layers where the lepton gradients are large. Both instabilities involve convective motions and hence can trigger dynamo actions that may be responsible for the large magnetic fields in neutron stars and magnetars. However, because they have rather different mean turbulent velocities, they are also likely to give rise to different types of dynamo. Methods. We have solved the mean-field induction equation in a simplified one-dimensional model of both the convective and the neutron-finger instability zones. Although very idealized, the model includes the nonlinearities introduced by the feedback processes that tend to saturate the growth of the magnetic field (α-quenching) and suppress its turbulent diffusion (η-quenching). The possibility of a dynamo action is studied within a dynamical model of turbulent diffusivity where the boundary of the unstable zone is allowed to move. A large number of numerical simulations have been performed in which the relevant parameters, such as the spin-period, the strength of the differential rotation, the intensity of the initial magnetic field, and the extent of the neutron finger instability zone, have been suitably varied. Results. We show that the dynamo action can also be operative within a dynamical model of turbulent diffusivity and that the amplification of the magnetic field can still be very effective. Furthermore, we confirm the existence of a critical spin-period, below which the dynamo is always excited independently of the degree of differential rotation, and whose value is related to the size of the neutron-finger instability zone. We provide a relation for the intensity of the final field as a function of the spin of the star and of its differential rotation. Conclusions. Although they were obtained by using a toy model, we expect that our results are able to capture the qualitative and asymptotic behaviour of a mean-field dynamo action developing in the neutron-finger instability zone. Overall, we find that such a dynamo is very efficient in producing magnetic fields well above equipartition, and thus that it could represent a possible explanation for the large surface magnetic fields observed in neutron stars.