We use magnetotransport in dual-gated magnetic topological insulator heterostructures to map out a phase diagram of the topological Hall and quantum anomalous Hall effects as a function of the chemical potential (primarily determined by the back gate voltage) and the asymmetric potential (primarily determined by the top gate voltage). A theoretical model that includes both surface states and valence band quantum well states allows the evaluation of the variation of the Dzyaloshinskii-Moriya interaction and carrier density with gate voltages. The qualitative agreement between experiment and theory provides strong evidence for the existence of a topological Hall effect in the system studied, opening up a new route for understanding and manipulating chiral magnetic spin textures in real space.