Direct torque control (DTC) is widely used in both industries and academia due to its distinctive advantages, e.g., fast dynamic response and high robustness against motor parameters uncertainties and external disturbances. However, there are also some major drawbacks of conventional DTC, such as large torque ripples and poor efficiency caused due to the use of non-optimal flux references. This paper proposes a model-free extremum seeking control (ESC) algorithm for a three-level (3-L) inverter to reduce torque ripples and improve the drive efficiency. Firstly, the relationship between the stator flux linkage and the magnitude of stator current is analyzed. Then, based on this relationship, an effective high frequency signal injection (HFSI) based ESC algorithm is proposed to determine the optimal reference flux in real-time, leading to a maximum torque per ampere (MTPA) like approach for the 3-L DTC. This method can reduce the time-consuming tuning effort and is very robust to the motor parameters variations. The feasibility and effectiveness of proposed methods are verified by using both simulation and experimental studies.