Pancreatic ductal adenocarcinoma (PDAC) is a tumor with a dismal prognosis that arises from precursor lesions called pancreatic intraepithelial neoplasias (PanINs). Progression from low- to high-grade PanINs is considered as tumor initiation, and a deeper understanding of this switch is needed. Here, we show that synaptic molecule neuroligin-2 (NLGN2) is expressed by pancreatic exocrine cells and plays a crucial role in the regulation of contact inhibition and epithelial polarity, which characterize the switch from low- to high-grade PanIN. NLGN2 localizes to tight junctions in acinar cells, is diffusely distributed in the cytosol in low-grade PanINs and is lost in high-grade PanINs and in a high percentage of advanced PDACs. Mechanistically, NLGN2 is necessary for the formation of the PALS1/PATJ complex, which in turn induces contact inhibition by reducing YAP function. Our results provide novel insights into NLGN2 functions outside the nervous system and can be used to model PanIN progression.