For strict definitiond of necessary (see also sufficient) this is correct.
A is not necessary for B if a single instance of B exists without A.
In colloquial terms it is frequently used to suggest a recommendation with an imperitive need.
Different things for the same word. Only the former can be used to determine if something is necessary, the latter is a subjective assertion and can have no proof either way.