Yes, but most times, they have to hit your conn for the torps to explode, else they'll pass over you, so if you see the screen pop-up, crash dive, which does the ahead flank, and you might get missed by that one - of course though, you could well drive into the path of another two...
One thing I wonder though, you say it was dark, and they saw your scope, you're guessing, by the moonlight? That would be off a bit, I would think, but continuous scope up might contribute... As a basic necessity, CapnScurvy brought the torpedo firing range in to 1500 yards or less, else the ships / subs ran themselves out of torpedoes, so there's really not a lot of reaction time to them. If there was an actually way to get "AI_Aiming", we'd have it made, and could take their shooting range out further, allowing for an actual good reaction to them - if a person is paying attention...

- I have a difficult time as it is, remembering about airplanes and bombs when cruising along at PD, lining up for a shot...