This is not really the case in TWoS in general...
Maybe just in case of Polish destroyers in opening Danzing mission because your position could be "relayed" from nearby Polish submarines which also operates in the area. Maybe they just spotted you before you dived or maybe they can pinpoint your approximate location with their hydrophones? There are many possibilities...