At a little past 9:30 p.m. Tuesday, the head of a little-known data analytics team working for Donald Trump in San Antonio sent a flurry of messages to the campaign’s New York war room: Florida had tipped and the models were predicting a more than 50% chance he would win the presidency.

Until then, the number-crunching and analytics for Mr. Trump felt more like a “data experiment,” said Matthew Oczkowski, head of product at Cambridge Analytica, who led the team for nearly six months.

“I...