The former Prime Minister said Mr Johnson's proposals will need to be weakened in order for an agreement to be reached, but said the EU would also need to give ground.
Mr Johnson has said that his blueprint to resolve the issue of the Northern Ireland backstop represents a "fair and reasonable compromise".
However, EU leaders have so far refused to enter into detailed discussions on the plan, saying it does not represent the basis for a new Brexit settlement.
Mr Cameron, speaking to The Times editor John Witherow at an event to promote his memoirs, said: "The answer I suspect is now compromise on both sides," he told the audience at the Barbican centre in London on Monday.
"Boris is compromising and I suspect may have to move a bit more. And the EU should compromise too."
The former premier also said Mr Johnson could not ignore the Benn Act which requires him to ask the EU for a further delay to Brexit if he cannot get a deal by October 19.
"You can't disobey the law as Prime Minister," he said.
Mr Johnson has repeatedly said that while he will abide by the law, Britain is leaving on October 31 come what may - although he has yet to explain how that can be achieved.
The Spectator political editor James Forsyth quoted a source in No 10 as saying there were "all sorts of things" they could do to scupper a delay.
The source was also quoted as blaming Irish premier Leo Varadkar for refusing to negotiate, and warning that if Mr Johnson's plan "dies" in the next few days it would not be revived
- Read more
"To marginalise the Brexit Party, we will have to fight the election on the basis of 'No more delays, get Brexit done immediately'," the source is quoted as saying.
Mr Cameron however warned there was no guarantee the Conservatives would win a general election, which Mr Johnson has been pressing for.
"I fought an election in 2015 when I was told I was definitely going to lose, and I won. And I fought a referendum (on leaving the EU) and I was told I was definitely going to win, and I lost," he said.
"The trouble with general elections is you're asking one question, but people may easily go and vote on any number of other questions".
Meanwhile, the opposition parties remain divided on how best to prevent a no-deal Brexit.
The latest meeting of party leaders at Westminster ended on Monday without agreement, amid accusations Labour leader Jeremy Corbyn was acting as a "barrier" to an agreement.
Labour has insisted that if Mr Johnson is defeated in a vote of confidence, Mr Corbyn should lead an interim government to seek a new Brexit delay - something the Liberal Democrats and rebel Tory MPs who lost party whip oppose.
Parliament is due to prorogue again at the end of business on Tuesday, ahead of the Queen's Speech on Monday setting out the Government's new legislative programme.
Meanwhile the Lib Dems received a further boost with the announcement that former Tory MP Heidi Allen has become the latest defector to join the party, taking their tally of MPs to 19.
The South Cambridgeshire MP has been sitting in the Commons as an independent since quitting the Change UK group in June.