The battle in the red-hot co-working space business is heating up.

WeWork, the No. 1 player in the sector, allegedly sent two spies to infiltrate rival Knotel — to steal info and some customers, Knotel claimed.

The spies showed up at seven Knotel properties in Manhattan last month in a “systematic attempt to pilfer Knotel’s proprietary information and trade secrets,” according to a cease-and-desist letter the smaller company sent to WeWork.

The Post has obtained a copy of the letter.

The corporate espionage rookies might have pulled off the caper — except, in a totally random happening, a Knotel employee recognized one of them as a friend of a friend, according to sources close to Knotel.

While the pair used fake names to gain entry, according to the letter, a call to the Knotel worker’s pal got the spy’s real name — and a couple of social media inquiries turned up the fact that he worked for rival WeWork, sources said.

The letter to WeWork asks for a reply by Oct. 13 — but so far Knotel hasn’t heard a peep from its rival, according to CEO Amol Sarva.

While inside the Knotel offices, visited Sept. 12-14, the luckless spies posed “as the founders of a fast-growing startup” and said they needed space for their six-person company, according to the letter.

The spies “provided minimal information about their company but made sure to ask detailed questions about the Knotel locations they were visiting,” according to the letter.

In addition to seeking info on services offered to small startups, the letter also says the spies reached out to a member of the Knotel sales team about services for larger companies — saying they were “heads of a fast-growing, 50-plus person company looking for a new headquarters.”

WeWork is the largest co-working company in the world, with over 200 locations in 52 cities around the world.

Knotel has 24 locations — all but one in the Big Apple. WeWork has 44 locations in New York City.

Sarva was upset by the underhanded tactics employed by WeWork, but told The Post he thinks the spying was undertaken by rogue employees, rather than at the directive of WeWork CEO Adam Neumann.

“The snoops were so amateurish and unethical that the project feels more like an improvised Keystone [Kops] spying operation than something dreamed up by [Neumann],” Sarva said. “At least, I give him the benefit of a doubt.”

No Knotel customers were stolen as a result of the spying episode, Sarva said.

WeWork did stop one of its clients from moving to Knotel — but only after offering them one year rent-free, Sarva said. That move, the CEO said, proves Knotel is getting under WeWork’s skin.

“If the company is discounting 100 percent, I suspect they all know they have problems,” he told The Post. “My question is: Did SoftBank hand them $4 billion to give away? Or to build the business?”

SoftBank recently invested $4 billion in WeWork.

A WeWork spokesperson did not deny the contents of the cease-and-desist letter despite multiple requests, but said only: “We believe that our offering is unique and exciting and want to make it as easy and enticing for as many people as possible to join our growing global community.”