This is quite confusing.
In the dictionary, they say
someone who helps you when you need it
Say, Tom was broke and he needed help and some financial support. Mary helped him while other friends of Tom didn't.
According to the above definition , we say "Mary is a friend in need" which means Mary helped Tom when he needs.
But we have the phrase "people in need" which refers to people who needs food or money.
need 7 [uncountable] when you do not have enough food or money
cases of severe need in the inner cities
We must care for those in need.
So, if we say "Mary is a friend in need", people may think "Mary is a friend who needs help, maybe she needs some food and money from her friends".
Is the phrase "Mary is a friend in need" confusing?