Five-membered azaheterocycles, mostly suffered from various synthetic problems, hold a special status in pharmaceutical chemistry and life science. Here, based on green chemistry, a highly efficient and remarkably regioselective photoreaction was developed under mild conditions for constructing fused five-membered azaheterocycles with aggregation-induced emission (AIE) characteristics. After the photoreaction, one of the most noteworthy optical features is the abruptly increased emission induced by UV irradiation. Making use of this, fluorescent photopatterns were readily fabricated in solution and solid support with improved signal-to-background ratio. Due to the excellent biocompatibility and unique chemical structure of the azaheterocycles, selective mitochondria-targeted cancer cell recognition was realized at an ultralow dye concentration. Notably, an unusual photoamplification effect and an exceptional anti-photobleaching phenomenon were observed thanks to the occurrence of the photoreaction. It is not only the first time that fused five-membered azaheterocyclic AIE luminogen was synthesized quantitatively via an unconventionally yet highly regioselective photoreaction, but also the first attempt to combat photobleaching problem by the photoamplification effect.