While the first casualty of the Japanese forces was an aircraft shot down by the Tautog during the raid on Pearl Harbor wisdom dictates that an aircraft flying at 200 mph should be avoided in a confrontation by a surface vessel traveling at best 20mph.
Dive and leave it alone. Anti-Air combat was required at times but with the advent of better radar submarines could dive well before the plane got there. An aircraft to a submarine is like a dirty partner:

They carry bombs and depth charges and all sorts of nasties.
Best avoid them.