They said her biological parents' fear that she was losing her religious heritage was insufficient to tear her away from a couple whose devotion had helped her survive severe breathing problems, which require the permanent use of a tracheotomy tube.
The child, one in a large family, has lived with her foster parents since the age of 17 months, when her biological mother's health problems prevented her from caring for her daughter.
At the time, no Jewish foster parents could be found to care for the child. The arrangement with the Catholic couple was intended to be temporary.
The judgment, described by one of the judges as the most distressing he has ever made, entitles the biological parents to have contact with their daughter four times per year.
He described the biological parents as "warm, decent, caring people," but he noted that the foster parents "should be commended for their unstinting devotion."
He said the girl's Jewish birthright entitled her to live her life in the practice, enjoyment and fulfillment of her Jewish faith.
But, he added, the court had to take into account her lack of understanding and appreciation, intellectual and emotional, of the faith into which she had been born.
Another member of the three-panel court said "no one would wish to deprive a Jewish child of her Jewish heritage."
However, she ruled that the child's religious heritage could neither be treated as an "overwhelming factor" nor displace important factors relating to the child's welfare.
For more JTA stories, go to http://www.jta.org