We consider theoretically the topological contribution to the anomalous Hall effect in narrow-gap IV-VI magnetic semiconductors in which the relativistic terms are relatively large and determine both the non-parabolicity of the energy spectrum and strong spin-orbit interaction. We use the relativistic Dirac model and linear response theory to calculate this contribution. Experimental data on the anomalous Hall effect in these compounds are also presented and discussed.