Hm, I put 'have to' instead of 'need to' and got marked wrong but they do mean the same thing in this case. Reported it as an error.
They are close, but not identic. "To need" is about necessity, "to have to" is about obligation.
I put "I need to turn off a light," and my answer was incorrect. Why? Where is the definite article?