Both election nights began with an establishment campaign confident of victory following an unusually nasty and confrontational political battle. Both ended up with an unexpected victory for populist right-wing candidates. Both saw pollsters, pundits, and journalists questioning how they called it very wrong.
The broad comparisons between Donald Trump's election as president of the United States and the Leave campaign's victory in the EU referendum are easy to make.
It'll take months and years of analysis to work out whether similar factors – an unexpectedly high turnout from traditionally non-voting white working class, journalists who didn't realise that fact-checking would be futile, and an unlikeable establishment campaign – were what cost Hillary Clinton the election.
What's certain, as experienced by this British reporter on the ground in largely liberal New York, is how the election night felt the same as Brexit.
Both nights played out in the same three-act structure. First there was the initial tentative expectation of victory among left-wing activists, then came the clutching at electoral straws as early results suggested an upset was on the cards, then there was the shellshocked realisation that The Thing That Wasn't Supposed to Happen really was happening.
And at the end of both nights UKIP leader Nigel Farage – victorious in the EU referendum and now the British politician with the closest links to the president of the UK's most important strategic ally – was left smiling.
For many New Yorkers – like the residents of the major British cities that voted Remain during the EU referendum – a Trump victory, representing the rejection of their liberal values, was difficult to take. As with Brexit there was a conviction until the very final minute that the traditional rules of politics, with voters reverting to the centre ground, would hold. Once again they didn't.
Early results contained warnings. Democratic counties in northeast Pennsylvania that had never previously been won by Republicans began to declare for Trump. Florida, which had seen reports of enormous turnout among Latinos, showed a dead heat with Clinton and Trump separated by just a few hundred votes out of 6 million at one point.
As the percentage of votes counted in Florida ticked up and up – to 80, 90%, 95% of the total – with Trump's lead still intact, Clinton supporters' search for electoral hope began. Forecasting models that had predicted a Clinton victory as a nailed-on certainty began to flip their projections.
During the EU referendum Remain supporters spent the closing hours of results night desperately hoping – even as the direction of travel became clear – that a strong pro-EU vote in late-declaring regions like London would outweigh the unexpectedly large Leave votes in the Labour constituencies of northern England.
Then finally there was the realisation for both Clinton and Remain supporters that the unthinkable was happening: Their opponents – the ones they had mocked mercilessly to their Facebook friends, had repeatedly fact-checked, had believed to be racist and unpleasant – were going to win.
Trump, who had dubbed himself "Mr Brexit", was the one celebrating.
Remain supporters who feel the UK changed forever as a result of the EU referendum are still working their way through the five stages of grief as they come to terms with the electoral result. Clinton supporters trying to come to terms with defeat in the presidential election could do worse than to look at what is happening on the other side of the Atlantic – but they need to know that the wounds take months to heal.