Khan, the candidate for Jeremy Corbyn's anti-austerity Labour Party, accused both Conservative politicians of attempting to "turn ethnic communities against each other" and using tactics "straight out of the Donald Trump playbook," the Guardian reports.
Khan, who was officially sworn into his new post on Saturday, was apparently referencing Trump's controversial anti-Muslim comments in an article he wrote for Sunday's Observer newspaper.
Khan, who is Muslim, says he hoped the mayoral campaign would focus on issues surrounding housing, transport and air pollution.
Instead, he said Cameron and Goldsmith attempted to win votes by dividing communities.
"They used fear and innuendo to try to turn different ethnic and religious groups against each other - something straight out of the Donald Trump playbook. Londoners deserved better and I hope it's something the Conservative Party will never try to repeat," he wrote.
Khan earlier criticized the Conservatives of running a "really nasty campaign" in their bid to hold on to the London mayor's post, held by Boris Johnson since 2008.
Cameron has yet to congratulate Khan on his electoral win, or even publicly acknowledge it.
The new mayor's comments echo criticism from senior Tories who broke away from their own party's position to condemn the Conservative London campaign as divisive.
"I was disgusted with the tone of (Goldsmith's) campaign and his repeated, and risible, attempts to smear Sadiq Khan and paint (him) as a closet extremist," wrote Chairman of the Conservative Muslim Forum, Mohammed Amin.
Cameron was accused of making racist comments about Khan for saying he "shared a platform" with extremists who support IS during Prime Minister's Questions ahead of the London vote.