The precise manipulation of microcirculation in mice can facilitate mechanistic studies of brain injury and repair after ischemia, but this manipulation remains a technical challenge, particularly in conscious mice. We developed a technology that uses micromagnets to induce aggregation of magnetic nanoparticles to reversibly occlude blood flow in microvessels. This allowed induction of ischemia in a specific cortical region of conscious mice of any postnatal age, including perinatal and neonatal stages, with precise spatiotemporal control but without surgical intervention of the skull or artery. When combined with longitudinal live-imaging approaches, this technology facilitated the discovery of a feature of the ischemic cascade: selective loss of smooth muscle cells in juveniles but not adults shortly after onset of ischemia and during blood reperfusion.