Israeli law might apply to foreign journalists operating in Israel but it would not apply to the NYT operating in the US! The NYT could have run the story without acknowledging a source or acknowledging a source outside Israel, e.g. a staff reporter.
Week of floods kills 22 in Vietnam (DPA)
from the article: The New York Times wrestles with Israel's gag orders