There was a horse once who could supposedly do math-
People of all kinds would come to the horse and try to stump him. But no matter what the problem was, the horse was able to give the correct answer. He would stomp his hoof the correct amount of times to answer every question- seemingly regardless of complexity.
Finally, someone was able to stump the horse with consistency- and come to find out---- the way to stump the horse is if the person asking the math problem didnt know the answer themselves.
The reason? Animals, (and human beings when they are tripping on hallucinogenics to a degree) are hyper-sensitive to body language - and other little ticks that we wouldn't normally pick up on. Our conscious mind- everything we experience with our 5 senses, as well as our conscious thoughts- take up so much of our awareness that we are not as privy to some subconscious triggers that are happening in great frequency all around us. Non-human animals, perhaps partially due to their lack of verbal phonetic communication are able to pick up on things that we would almost never to very rarely catch. In the case of the horse- it may have been something like a change in the persons body language/face/demeanor once the horse had stomped the correct amount of times.
The relevance to the OP is- there was very likely a trigger that put it in both of your minds that you shared- but you just werent aware of it consciously. So when you both had it in your head at the same time- it seemed supernatural to you.