I would think that in real life it might be possible for the u-boat to monitor the radio traffic and know the neutral was broadcasting their position. But I don't know if that would've been an "official" breach of neutrality and therefore justifiable grounds for considering the neutral a legitimate target.
That would be for lone ships, or ships sailing without (armed) enemy escorts. If they're already part of an enemy convoy, I'm not gonna feel bad about sinking one, heck it could happen by accident even if I wasn't aiming for them. (However for "scoring" purposes" the game would still consider them neutral and penalize you, even in those circumstances, unless you've done some modding of the basic.cfg as noted above.)