The valence of memories is malleable because of their intrinsic reconstructive property. This property of memory has been used clinically to treat maladaptive behaviours. However, the neuronal mechanisms and brain circuits that enable the switching of the valence of memories remain largely unknown. Here we investigated these mechanisms by applying the recently developed memory engram cell- manipulation technique. We labelled with channelrhodopsin-2 (ChR2) a population of cells in either the dorsal dentate gyrus (DG) of the hippocampus or the basolateral complex of the amygdala (BLA) that were specifically activated during contextual fear or reward conditioning. Both groups of fear-conditioned mice displayed aversive light-dependent responses in an optogenetic place avoidance test, whereas both DG- and BLA-labelled mice that underwent reward conditioning exhibited an appetitive response in an optogenetic place preference test. Next, in an attempt to reverse the valence of memory within a subject, mice whose DG or BLA engram had initially been labelled by contextual fear or reward conditioning were subjected to a second conditioning of the opposite valence while their original DG or BLA engram was reactivated by blue light. Subsequent optogenetic place avoidance and preference tests revealed that although the DG-engram group displayed a response indicating a switch of the memory valence, the BLA-engram group did not. This switch was also evident at the cellular level by a change in functional connectivity between DG engram-bearing cells and BLA engram-bearing cells. Thus, we found that in the DG, the neurons carrying the memory engram of a given neutral context have plasticity such that the valence of a conditioned response evoked by their reactivation can be reversed by re-associating this contextual memory engram with a new unconditioned stimulus of an opposite valence. Our present work provides new insight into the functional neural circuits underlying the malleability of emotional memory.