The present invention provides a nitrogen-containing heterocyclic compound represented by formula (I) and salt thereof (wherein, R 1 to R 6 each independently represents a hydrogen atom, unsubstituted or substituted C1-20 alkyl group and the like, R 1 and R 2 , R 3 and R 4 , or R 5 and R 6 may together form an unsubstituted or substituted 5- to 8-membered ring, A-B, in which A represents a carbon atom and B represents a nitrogen atom, represents the formula: C=N and the like, Y represents an oxygen atom and the like, X and X each independently represent an unsubstituted or substituted C1-20 alkyl group and the like, m represents an integer of 0 to 2, and n represents an integer of 0 to 4), and a fungicide for agricultural and horticultural use that contains at least one of these compounds as an active ingredient thereof, demonstrates reliable effects and can be used safely. The present invention further provides a boronic acid derivative that is a production intermediate of the aforementioned compounds, and a production method thereof.