Provided are a novel nitrogen-containing heterocyclic compound represented by formula (I), and a salt or N-oxide compound thereof. Also provided is an agricultural/horticultural germicide that contains at least one of the above as an active ingredient. In formula (I), R represents the group represented by CRRR or a cyano group. R through R each independently represent a hydrogen atom, an unsubstituted or substituted C alkyl group, an unsubstituted or substituted hydroxyl group, or the like. R or R represents a halogen group or the like. Y or Z represents a carbon atom or the like, and A or D represents a benzene ring or the like. X represents an oxygen atom, a nitrogen atom, or the like.