Tuberculosis is a disease that remains a significant threat to public health worldwide, and this is mainly due to the selection of strains increasingly resistant to Mycobacterium tuberculosis, its causative agent. One of the validated targets for the development of new antibiotics is DNA gyrase. This enzyme is a type II topoisomerase responsible for regulating DNA topology and, as it is essential in bacteria. Thus, to contribute to the search for new molecules with potential to act as competitive inhibitors at the active site of M. tuberculosis DNA gyrase B, the present work explored a dataset of 20,098 natural products that were filtered using the FAF-Drugs4 server to obtain a total of 5462 structures that were subsequently used in virtual screenings. The consensus score analysis between LeDock and Auto-Dock Vina software showed that ZINC000040309506 (pyrrolo[1,2-a]quinazoline derivative) exhibit the best binding energy with the enzyme. In addition, its subsequent optimization generated the derivative described as PQPNN, which show better binding energy in docking analysis, more stability in molecular dynamics simulations and improved pharmacokinetic and toxicological profiles, compared to the parent compound. Taken together, the pyrrolo[1,2-a]quinazoline derivative described for the first time in the present work shows promising potential to inhibit DNA gyrase B of M. tuberculosis.