Whoa there, fella. The "necessity defense" excuses the commission of a lesser offense if necessary to prevent or terminate the commission of a greater offense by someone else.
Self-defense (which includes "defense of another") has a necessity component, which varies by state and circumstances, but it is not related to the "necessity defense." And, while it is an "affirmative defense" in Massachusetts, that only means that self-defense must be plead, not proved. Once effectively raised, the burden of proof negating self-defense is on and remains with the Commonwealth.