In Drosophila, in vivo functional imaging studies revealed that associative memory formation is coupled to a cascade of neural plasticity events in distinct compartments of the mushroom body (MB). In-depth investigation of the circuit dynamics, however, will require an ex vivo model that faithfully mirrors these events to allow direct manipulations of circuit elements that are inaccessible in the intact fly. The current ex vivo models have been able to reproduce the fundamental plasticity of aversive short-term memory, a potentiation of the MB intrinsic neurons (Kenyon cells; KCs) responses after artificial learning ex vivo. However, this potentiation showed different localization and encoding properties from those reported in vivo and failed to generate the previously reported suppression plasticity in the mushroom body output neurons (MBONs). Here, we develop an ex vivo model that recapitulates behaviorally evoked plasticity in the KCs and MBONs. We demonstrate that this plasticity accurately localizes to the MB α'3 compartment and is encoded by a coincidence between KCs activation and dopaminergic input. The formed plasticity is input-specific, requiring pairing of the conditioned stimulus (CS) and unconditioned stimulus (US) pathways; hence we name it pairing-dependent plasticity (PDP). PDP formation requires an intact CaMKII gene and is blocked by previous-night sleep deprivation but is rescued by rebound sleep. In conclusion, we show that our ex vivo preparation recapitulates behavioral and imaging results from intact animals and can provide new insights into mechanisms of memory formation at the level of molecules, circuits, and brain state.