An interaction of 6-aryl-1,2,4-triazine-5-carbonitriles with 2‑amino-4-aryl-substituted thiazoles and oxazoles has been studied. The difference in the reactivity of these aminoheterocycles depending on the presence of an oxygen or a sulfur atom in their composition has been demonstrated. Previously, the 4-aryl-3-hydroxy-2,2′-bipyridines were obtained as products of aza-Diels−Alder reaction between 6-aryl-3-(2-pyridyl)-1,2,4-triazine-5-carbonitriles and 2-amino-4-aryloxazoles. It was shown that the reaction of 6-aryl-1,2,4-triazine-5-carbonitriles with 2-aminothiazoles led to the products of ipso-substitution of cyano group. The aza-Diels−Alder reaction of these compounds with 2,5-norbornadiene gave (2,2′-bi)pyridines with the 2-aminothiazolyl at alpha-position.