Lindsay Lohan is facing an ugly legal battle after she and her younger brother, Michael Jr., allegedly lifted the idea for a fashion e-commerce site from a former business associate.

After completing 90 days in rehab last year, Lohan and Michael Jr. are said to have struck a deal with tech entrepreneur Fima Potik to collaborate on his startup, Spotted Friend, a mobile application that allows users to access celebrities’ and friends’ “virtual closets” to identify the designers and buy items from them.

Lindsay tweeted about Spotted Friend in July 2013, and at the time its Web site said, “A Fima Potik & Lindsay Lohan Production.” Last month, Page Six reported that LiLo’s little brother was raising money for Vigme, a “social shopping community.” He said, “If Lindsay buys something, it goes into her [virtual] closet. People see what’s in her closet. If someone else buys [the same item], it puts money into Lindsay’s pocket.”

Now LiLo, Michael Jr. and business partner Christopher Roth have been hit with a cease-and-desist letter from Potik. His lawyer, Marc E. Kasowitz, wrote, “Prior to their involvement in Vigme, [the Lohans and Roth] were members of Spotted Friend LLC, a social commerce startup that was founded by Fima Potik in 2013. It is Mr. Potik — not the Lohans — that created and developed the idea for a mobile application that allows users to access celebrities’ and friends’ ‘virtual closets’ and to directly purchase fashion items and accessories from these ‘virtual closets.’

“In 2014, after being members of the company for over a year, without any warning, the Lohans and Mr. Roth launched a competing company and improperly took proprietary information and intellectual property from Spotted Friend to start the new business. We intend to take all action necessary . . . to protect Spotted Friend’s and Mr. Potik’s legal rights and commercial interests.”

But Lohan’s attorney, Mark J. Heller, said, “Allegations of any impropriety in Lindsay Lohan’s business relationship concerning this Web site are inaccurate and clearly designed to capitalize on her worldwide recognition as a fashion icon.”