The present invention relates to a nitrogen-containing heterocyclic compound or salt thereof, represented by the following formula (I), and a pest control agent containing the compound or salt thereof, as an active ingredient of the pest control agent:(wherein, R0 represents a halogen atom, or the like Z represents an unsubstituted or substituted aryl group, or the like Y represents a nitro group, or the like n represents an integer of 0 to 3 D represents a 5-membered to 8-membered hydrocarbon ring group or heterocyclic group X represents a functional group represented by the following formula (II)-1 or formula (II)-2:(wherein, in the formula (II)-1, the dotted line represents a single bond or double bond, and R1 and R2 respectively and independently represent a hydrogen atom, nitro group, hydroxyl group, mercapto group, unsubstituted or substituted amino group, or organic group and, in the formula (II-2), W represents an oxygen atom or sulfur atom and, R11 represents a hydrogen atom, hydroxyl group, mercapto group, unsubstituted or substituted amino group, or the like) n1 represents an integer of 0 to 2 and, A represents a carbon atom or nitrogen atom).