The ability to map patterns of gene expression noninvasively in living animals could have impact in many areas of biology. Reporter systems compatible with MRI could be particularly valuable, but existing strategies tend to lack sensitivity or specificity. Here we address the challenge of MRI-based gene mapping using the reporter enzyme secreted alkaline phosphatase (SEAP), in conjunction with a water-soluble metalloporphyrin contrast agent. SEAP cleaves the porphyrin into an insoluble product that accumulates at sites of enzyme expression and can be visualized by MRI and optical absorbance. The contrast mechanism functions in vitro, in brain slices, and in animals. The system also provides the possibility of readout both in the living animal and by postmortem histology, and it notably does not require intracellular delivery of the contrast agent. The solubility switch mechanism used to detect SEAP could be adapted for imaging of additional reporter enzymes or endogenous targets.