Both 必要ない and いらない(要らない) can be used to say "I don't need" "~~is not needed", and you can use them interchangeably in some cases, depending on the context. 必要ない sound more literary so いらない is more used in daily conversation. Also, いらない is often used to say "I don't want it" in a quite casual way, eg. 「お茶飲む?」--「いらない。」/「おかわりは?」--「いらない。」