I think Remain becoming seen as an anti-racist vote probably played well for it in London. In fact the more I think of it the fact the public debate was so dominated by immigration, along with Leave being so associated with Farage/UKIP, probably most benefitted Remain. How many people said, even on here that they just couldn't stand to vote with Farage and Boris - that will have been a factor in London and other big urban centres.
If the referendum had been fought on a more broad range of issues then I suspect Remain would have been even more fucked. I wonder if they knew this, that they couldn't win from the right on immigration beyond a few dog whistles, but they might win by keeping the campaign focussed on immigration and presenting Leave as a racist vote.