Dendritic spines have been proposed to function as electrical compartments for the active processing of local synaptic signals. However, estimates of the resistance between the spine head and the parent dendrite suggest that compartmentalization is not tight enough to electrically decouple the synapse. Here we show in acute hippocampal slices that spine compartmentalization is initially very weak, but increases dramatically upon postsynaptic depolarization. Using NMDA receptors as voltage sensors, we provide evidence that spine necks not only regulate diffusional coupling between spines and dendrites, but also control local depolarization of the spine head. In spines with high-resistance necks, presynaptic activity alone was sufficient to trigger calcium influx through NMDA receptors and R-type calcium channels. We conclude that calcium influx into spines, a key trigger for synaptic plasticity, is dynamically regulated by spine neck plasticity through a process of electrical compartmentalization.