By confining the secondary dimethylammonium (DMA) cation in a distorted perovskite cavity, we assembled a new 2D Ruddlesden-Popper metal halide perovskite of (i-BA)2(DMA)Pb2Br7 (i-BA = n-isobutylammonium), in which the DMA cation templates its inorganic perovskite framework and the quantum-well motif renders a fascinating photoresponse. Crystal-based planar arrays exhibit effective photodetection behaviors, including a notable detectivity (∼5.6 × 1012 Jones), a high responsivity (∼1.25 A W-1) and a large switching ratio (∼1.5 × 103). These properties result from its low dark current restricted to the hopping barrier of the insulated organic bilayer and a strong in-plane photoresponse correlated with the perovskite network. This work throws light on the targeted exploration of photosensitive candidates in the family of organic-inorganic hybrid perovskites, as well as high-performance devices.