Wendy Lomax, who once served with the RAF, uses a wheelchair and is confined to bed for large portions of the day.
She had written to Gosport Borough Council to ask to be housed in the town where she has family who could care for her.
At the moment,Â her 24-hour care is provided by her ex-partner, who intends to move away from the isolated rural area of Dorset where Ms LomaxÂ lives in an adapted housing association bungalow.
Without public transport or voluntary transport with wheelchair access, she cannot get out of the house, said Lord Justice Lewison in London.
Thunderstorms in Portsmouth yellow weather warning: The Met Office forecast for the next three days in city, Fareham, Gosport, Havant and Waterlooville and Hampshire
Police update on probe into death of ‘Wiggy’ Symes after fatal dog attack in Fareham
Emergency crews battling to save someone’s life on Southsea seafront
Southsea seafront incident: Police update after man found 'unresponsive'
River Ems crisis: Westbourne villagers plead with Portsmouth Water to introduce a hosepipe ban
She had no visitors, was unable to engage with herÂ community and, once her former partner left, would be alone.
In consequence, she was '˜extremely isolated', which made her depressed.
Her familyÂ in Gosport were able and willing to provide the support she needed and she wished to move near them.
She applied to Gosport Borough Council for assistance as a homeless person on the basis that, although she was physically housed, it was not reasonable for her to continue to occupy her accommodation.
After her application was refused, it was reviewed by a senior housing options officer who decided it was reasonable for her to stay where she was.
TodayÂ Ms Lomax, who had the support of her GP, her housing association, the Equality and Human Rights Commission and the RAF Association, won her challenge at the Court of Appeal.
Lord Justice Lewison, sitting with two other judges, said what tipped the balance for the reviewing officer was the relative scarcity of housing in Gosport.
Although the officer acknowledged there was an impact on Ms Lomax's health from staying put, he overlooked or downplayed the highly material and unchallenged evidence that her mental health was being positively damaged by remaining and the medical opinion that an immediate move was required.
When the officer balanced the various considerations, the two major factors that he took into account were the '˜physical suitability'Â of the Dorset property and the housing situation in Gosport.
Lord Lewison said: '˜As to the former, it was only suitable if its location was ignored.
'˜As to the latter, the reviewing officer repeated his statement that there were 'many households living in accommodation that is not ideal for them'.
'˜I think it inescapable that the reviewing officer did regard Ms Lomax and the other households as being 'in the same unfortunate boat'.
'˜For the reasons I have given, I consider that that evaluation was erroneous.'
Julie Smith, head of housing at Gosport Borough Council, said: '˜We will be meeting to consider the judgement early next week before deciding on our next steps.'