LONDON — Two senior advisers to Prime Minister Theresa May might have conspired to bypass electoral spending laws when they were leading a campaign for Britain to leave the European Union, a former employee of their effort said this week, in an interview and in testimony he gave to the country’s elections regulator.

The allegations led to a heated exchange, conducted in the British news media, involving allegations of hard feelings over an old romance and of the deliberate outing by the prime minister’s office, No. 10 Downing Street, of the former employee as gay.

The former employee, Shahmir Sanni, said in the interview and in a witness statement submitted to the regulator, the Electoral Commission, that the two advisers had funneled more than $900,000 in campaign spending through a puppet organization that they had set up. They did so, he said, by paying the money to a digital advertising firm that was indirectly linked to the Trump campaign and also worked on the push to exit the European Union.

Mr. Sanni volunteered at Vote Leave, the main campaign led in part by the two advisers to the prime minister, and then at the organization that he now says was a puppet, called BeLeave. He spoke with The New York Times for a joint reporting project with The Observer of Britain.