In a ruling with significance for social services departments all over the country, three appeal court judges decided responsibility for the boy, referred to in court only as 'N', lies with Islington LBC.
They overturned an earlier court ruling that Northamptonshire CC - in whose area the boy's mother lives - should bear the 'labour and expense' of caring for the boy.
Lord Justice Thorpe said the boy's parent's separated in 1996 and his care 'fluctuated' between his mother in Northampton and his father in Islington.
And the judge said it was in the same year that his mother began cohabiting with a convicted sex offender.
In October 1996, the mother secured 'N''s return to Northampton 'by a ruse'.
But the following year a judge ordered the boy should live with his father, on condition the father made his best efforts to ensure 'N' was not left alone with his first cousin.
But, between January and July 1997, 'N' had lived under the same roof as his first cousin in Islington.
And, on July 10 1997, the judge said 'N' was 'assaulted by his father and aunt for having disclosed his cousin's abuse.'
Islington social services moved 'N' to the security of a children's home in west London, and the father wrote to the mother saying he no longer wished to care for the boy.
Islington rejected the mother's offer to care for 'N' and started care proceedings.
At Northampton county court in November last year, Judge Hall made care orders in respect of both 'N' and his two sisters who, until then, had lived with their mother.
Lord Justice Thorpe said there was no doubt the county council was responsible for the girls' care, but dispute arose as to which council should be designated as responsible for 'N'.
'Where there is more than one candidate for designation contests are common since the consequence of designation is generally labour and expense to the selected local authority,' observed the judge, sitting with Lord Justice Beldam and Lord Justice Pill.
He agreed it would be more convenient and in 'N''s interests for his care to be the responsibility of Northamptonshire.
'N''s long-term need was for a foster placement in the county and it would be better for both him and his sisters to be cared for by the same local authority.
But, under the terms of the 1989 Children Act, the critical issue was where 'N' was resident when the circumstances arose which led to the making of the care order.
'On the facts of this case that was plainly Islington,' ruled Lord Justice Thorpe.
Although there were 'practical advantages' in Northamptonshire having responsibility for all three children, he said the county council's designation as 'N''s carer had been 'wrong in law'.
'I would allow this appeal and substitute Islington for Northamptonshire as the designated local authority.'
The judge said that, since Judge Hall's ruling, the county council had 'commendably endeavoured' to do its best for 'N' and a suitable foster family had now been found in the county to which 'N' would hopefully move next month.