Microchimerism
(media.scored.co)
That's a very good question but there are dozens of ways other cells, male or female could enter the body. Orally, nasally or other membranes. Spit, skin shed, hair, etc. Jumping to the conclusion that it's from unprotected sex is the wacky part. Heck, since it's in the brain it's far more likely to be nasally since the nasal-brain barrier is far more exposed. Not to mention the whole "sperm is diploid" thing.