Two isolated circuits (different ground) detecting contact with each other
For reliable communications, you must include a second wire, connecting the grounds.  If you wish to maintain isolation, I’d suggest something like an optoisolator between them.