The Ukip leader and leading Leave campaigner said the Government's 48-hour extension to the registration deadline because of technical difficulties "may be what tipped the balance".
He also suggested that MP Jo Cox's death "might be part of it".
After the polls closed, Mr Farage said analysis carried out by "some of my friends in the financial markets" showed Britain has voted to stay in the EU.
Speaking as the first results came through, Mr Farage told reporters: "Win or lose this battle tonight, we will win this war. We will get our country back, we will get our independence back and we will get our borders back."
Attacking the Government for allowing millions of extra voters to join the polls, he said: "I hope and pray that my sense of this tonight was wrong and my sense of this, and no, I'm not conceding, but my sense of this, is that the Government's registration scheme, getting two million voters on, the 48 hour extension, may be what tipped the balance.
"I hope I'm wrong. I hope I'm made a fool of, believing that to be the case."
Asked by Sky News what happened to his campaign, which had edged ahead in the polls in past weeks, he said: "There was a very major event, a very major tragic event and that might be part of it. But actually to say we were running away with it is not right."
Pushed on whether MP Jo Cox's death has cost him his vote, he said: "No, I'm not saying that."
However, Ukip's only MP Douglas Carswell criticised his leader for blaming the registration extension.
He told the BBC: "I think it is very important to show respect for democracy which has just been through a very prolonged debate.
"I think we can legitimately complain about taxpayer-funded propaganda, about the Treasury pumping out a forecasts fiction.
"But when it comes to getting people engaged in a referendum, surely that's a good thing.
"We've waited 40 years for this moment. Getting more people to engage in the process is a good thing. There are lots of things we can complain about but I don't think that should be one of them."
Mr Farage said the the "eurosceptic genie is out of the bottle and it will now not be put back", affecting the mood across Europe.
He said: "If we do stay part of this Union, it is doomed, it is finished anyway.
"If we fail tonight it will not be us that knocks out the first brick from the wall but somebody else."
Meanwhile, Mr Farage warned the Government against overruling the referendum result if Leave wins.
He told ITV News: "If we win this referendum tonight what has to happen is the British Government has to carry out the wishes of the British people and it will be Ukip and Ukip alone, there posing an electoral threat to make sure that it actually happens.
"And I say that because the Danes rejected Maastricht - forced to vote again, the Irish twice rejected treaties - forced to vote again, and the French and the Dutch rejected the EU constitution but got it ported via the back door.
"If we get the try tonight that's wonderful but we need to convert it as well."