When we dream, melatonin and oxytocin are released. Melatonin is released when it's dark to make us sleepy. Oxytocin is the hormone that mediates social bonding in waking life as well as dreams.