Media playback is unsupported on your device
Michael Gove has defended government plans to override parts of the Withdrawal Agreement as a means of protecting the "integrity" of the UK.
The cabinet minister claimed the UK was being "generous" with the EU over the Brexit negotiations.
The EU has said the UK could face legal action over its Internal Market Bill, linked to trade between Britain and Northern Ireland.
PM Boris Johnson is urging Tory MPs to back the bill.
The bill, which will be formally debated in the House of Commons for the first time on Monday, addresses the Northern Ireland Protocol - the part of the Brexit Withdrawal Agreement designed to prevent a hard border returning to the island of Ireland.
If this became law it would give UK ministers powers to modify or "disapply" rules relating to the movement of goods between Britain and Northern Ireland that will come into force from 1 January, if the UK and EU are unable to strike a trade deal.
Northern Ireland Secretary Brandon Lewis has admitted parts of the bill, which would go against the Withdrawal Agreement signed by the UK and EU, would "break international law in a very specific and limited way".
But Mr Gove said the attorney general had said the government was acting within the rule of law - and that it was important to have an "insurance policy".
He insisted the government was being "proportionate and generous" in its approach to the EU talks.
Mr Gove said: "These steps are a safety net, they're a long-stop in the event, which I don't believe will come about but we do need to be ready for, that the EU follow through on what some have said they might do which is, in effect, to separate Northern Ireland from the rest of the United Kingdom."
While admitting it was a "crunch moment", he insisted "we have got the support of our own MPs".
No more 'miserable squabbling'
The EU and UK have less than five weeks to agree a deal before Mr Johnson's 15 October deadline - after which he says he is prepared to "walk away".
Informal talks are due to resume on Monday, with the next official round of talks - the ninth since March - starting in Brussels on 28 September.
The EU says the planned changes must be scrapped or they risk jeopardising the UK-EU trade talks.
Image copyright EPA Image caption Boris Johnson said he would not countenance "the threat of a border down the Irish Sea"On Friday Mr Johnson had a Zoom call with about 250 of his MPs, in which he said the party could not return to "miserable squabbling" over Europe.
It comes amid a plan to amend the legislation from senior Conservatives who are angered that international law could be broken by overriding the Withdrawal Agreement signed by the prime minister last October.
Both Ireland and the EU have warned that Mr Johnson's plans pose a serious risk to the peace process rather than protecting the Good Friday Agreement, as the government claims.
The prime minister has said it had become clear that there might be a "serious misunderstanding" between the UK and EU over the Withdrawal Agreement.
He said the UK must be protected from what he called a "disaster" of the EU being able to "carve up our country" and "endanger peace and stability in Northern Ireland".
Mr Johnson said there was still a "very good chance" of the UK and EU striking a deal by mid-October similar to that previously agreed between the EU and Canada - which got rid of most, but not all, tariffs on goods.
But in a column in the Daily Telegraph, he accused the EU of adopting an "extreme" interpretation of the Northern Ireland Protocol to impose "a full-scale trade border down the Irish Sea" that could stop the transport of food from Britain to Northern Ireland.
Mr Gove told BBC Radio 4's Today programme it would be "irrational" not to allow the transportation of food in such a way, which would happen if the UK was not granted third-country listing. Such a listing is needed for the export of food.
Conservative backbencher Sir Bob Neill, who chairs the Commons Justice Committee, is tabling an amendment to the bill to try to force a separate parliamentary vote on any changes to the Withdrawal Agreement.
"I believe it is potentially a harmful act for this country, it would damage our reputation and I think it will make it harder to strike trade deals going forward," he said.