The word for having someone else’s memories is called “cryptomnesia”. There’s even a Wikipedia page about it.
from wikipedia:
Cryptomnesia occurs when a forgotten memory returns without it being recognized as such by the subject, who believes it is something new and original.