We have developed a convenient protocol for synthesizing N-(2-pyridyl)-substituted 4-(amino)quinazolin-2(1H)-ones by reacting N,N-dimethyl-N′-pyridylureas with 2-aminobenzonitriles. The method relies on the ability of N,N-dimethyl-N′-pyridyl/quinolinyl ureas to act as masked isocyanates under thermal activation, followed by a Dimroth rearrangement of 4-imino-3-(hetaryl)-3,4-dihydroquinazolin-2(1H)-ones. Conducted at 120 °C, either in DMF or under solvent-free conditions, this approach has produced 28 derivatives of 4-aminoquinazolinones, featuring pyridine or quinoline substituents, with yields of up to 92%.