Here's what I'd do in your situation...
If he's super close, and he's been ID'ed as a big juicy target, then he's worth trying to sink. Since visibility is nil, running on the surface should not be a problem. I'd deck gun him to death, but that's the easy way so I'll pretend I'm on the USS Perch with no deck gun like I've played my last three patrols. (Gawd I miss the Narwhal)
Playing realistically, by that I mean not save and load when screwing up, I would assume that the tanker has spotted us. Using the "marker" on the map I'd mark it at the end of the sonar line every time it is significantly changed. Back off and watch (or listen I should say) to what he's doing. After getting a general heading, zip around and flank him. Get to withing 600-1000 yards at as close to 90 degrees as possible to his flank. Fire a spread of at least 4 torpedoes, each off about 1 degree left and right. (6 torps if in a modern boat)
Wait and see...