In response to the order the US-based social networking site revealed IP addresses a string of numbers identifying the computer being used connected to two accounts that were uploading personal information and private pictures, lawyer Yohei Shimizu said.
"The posts included photos that could be considered to be revenge porn," Shimizu told AFP.
"Even though my client could guess who was behind it, she had no proof."
Shimizu said the court order was made in the middle of August over two accounts that were being, falsely, managed in his client's name, and that Facebook had complied with the judge's ruling 10 days later.
Identifying a person who is masquerading as someone else online is not an easy task, Shimizu said. But when armed with the fake account's IP address, his client had been able to approach the Internet provider.
He said it was the first such case in Japan involving the world's largest social network, but added Tokyo District Court had issued a similar order in a separate case involving defamation in August.
Earlier this month a Japanese court ordered Google to delete search results linking the claimant to a crime he did not commit, the latest in a series of rulings around the world on what search engines should tell users.
Britain's government has proposed creating a new criminal offence of posting "revenge porn", punishable by a maximum jail term of two years.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.