To survive, animals must recognize reoccurring stimuli. This necessitates a reliable stimulus representation by the neural code. While synaptic transmission underlies the propagation of neural codes, it is unclear how synaptic plasticity can maintain coding reliability. By studying the olfactory system of Drosophila melanogaster, we aimed to obtain a deeper mechanistic understanding of how synaptic function shapes neural coding in the live, behaving animal. We show that the properties of the active zone (AZ), the presynaptic site of neurotransmitter release, are critical for generating a reliable neural code. Reducing neurotransmitter release probability of olfactory sensory neurons disrupts both neural coding and behavioral reliability. Strikingly, a target-specific homeostatic increase of AZ numbers rescues these defects within a day. These findings demonstrate an important role for synaptic plasticity in maintaining neural coding reliability and are of pathophysiological interest by uncovering an elegant mechanism through which the neural circuitry can counterbalance perturbations.