Provided are a nitrogenous heterocyclic aromatic compound, a preparation method therefor, a pharmaceutical composition thereof, and an application thereof. The nitrogenous heterocyclic aromatic compound can be used for treating and/or preventing various diseases mediated by ALK5.