I have an idea of how to go about it, but don't know quite what is possible or not.
Basically I would use the Highwayman style of approaching the NPC without actually being in combat, so there is no battle music.
On reaching the player I could have the player get knocked out/down when that NPC is within talking distance and is not seen by the player.
The only way I know of is to use the players facing direction, to determine if the player is facing away from the NPC or not. But this is not quite how I would like it, because the player, in theory, could see the enemy but turn away afterwards and still get knocked out.
But how do I determine if the player has seen the NPC?