"Congratulations Sadiq Khan. Can't wait to work with you to create a London that is fair for all!" Labour leader Jeremy Corbyn wrote on Twitter.
The 45-year-old son of a London bus driver and a seamstress won out against Conservative rival Zac Goldsmith, 41, the son a wealthy tycoon.
Goldsmith accused Khan of supporting Muslim extremists in a campaign that was widely criticised, including by members of Goldsmith's own Conservative Party.
The local MP for Tooting, Khan succeeds the charismatic Boris Johnson, an advocate of Britain's departure from the European Union who is seen as one of the favourites to succeed Cameron.
"Sending congratulations to London's new mayor and fellow affordable housing advocate Sadiq Khan," de Blasio said.