A sub can move through a sz that contains enemy units, in either combat or non-combat. It treats a hostile sz as a friendly one.
However, if that sz contains an enemy destroyer then the sub must end its movement there. If ending movement in a sz with an enemy destroyer during the combat phase then a battle will occur. If in non-combat then no battle.