When can 要 replace 需要?
要；yào；want, want to (想要), need to (須要), going to (將要).


需要；xūyào；need

We can use 要 instead of 須要 when we want to express need to + verb. However, we might not always want to replace 需要 with 要, because the meaning of 需要 is clearer: it always means 'need', while the meaning of 要 might cause confusion, as it can mean 'want to, need to or going to'.
On the other side, we shouldn't use 要 in place of 需要 when we want to express need + noun, such as in:

为什么人类需要氧气才能生存?
Why does mankind need oxygen to be able to survive?

氧气 is a noun; '需要氧气' (need oxygen) cannot be changed to 須要氧气 (need to oxygen), 想要氧气 (want to oxygen) or 將要氧气 (going to oxygen).
If the sentence was '須要有氧气' (need to have oxygen), then it can be changed to 要有氧气 because 有 is a verb.