In the ruling, which overturned a lower court's decision, the Berlin appeals court said the right to private telecommunications extended to electronic communication that was meant only for the eyes of certain people.
Privacy remains a sensitive issue in Germany due to extensive surveillance by Communist East Germany's Stasi secret police and by the Nazi era Gestapo. Memories of espionage were stirred anew by Edward Snowden's 2013 revelations of prying by the United States.
In the Facebook case, the mother of a 15-year-old who was hit and killed by a subway train in Berlin in 2012 had sought access to her daughter's account to search for clues as to whether the girl had committed suicide.
Facebook had refused access to the account, which had been memorialized, meaning it was effectively locked and served as a message board for friends and family to share memories.
It had also said that the girl's right to privacy was not protected because she was a minor and it was up to her parents to protect her rights.
The appeals court said on Wednesday that the right to private telecommunications outweighed the right to inheritance, and that the parents' obligation to protect their daughter's rights expired with her death.
(Reporting by Maria Sheahan Editing by Jeremy Gaunt)
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)