Barrett's esophagus (BE) and gastric intestinal metaplasia are related premalignant conditions in which areas of human stomach epithelium express mixed gastric and intestinal features. Intestinal transcription factors (TFs) are expressed in both conditions, with unclear causal roles and cis-regulatory mechanisms. Ectopic CDX2 reprogrammed isogenic mouse stomach organoid lines to a hybrid stomach–intestinal state transcriptionally similar to clinical metaplasia; squamous esophageal organoids resisted this CDX2-mediated effect. Reprogramming was associated with induced activity at thousands of previously inaccessible intestine-restricted enhancers, where CDX2 occupied DNA directly. HNF4A, a TF recently implicated in BE pathogenesis, induced weaker intestinalization by binding a novel shadow Cdx2 enhancer and hence activating Cdx2 expression. CRISPR/Cas9-mediated germline deletion of that cis-element demonstrated its requirement in Cdx2 induction and in the resulting activation of intestinal genes in stomach cells. dCas9-conjugated KRAB repression mapped this activity to the shadow enhancer's HNF4A binding site. Altogether, we show extensive but selective recruitment of intestinal enhancers by CDX2 in gastric cells and that HNF4A-mediated ectopic CDX2 expression in the stomach occurs through a conserved shadow cis-element. These findings identify mechanisms for TF-driven intestinal metaplasia and a likely pathogenic TF hierarchy.