MPs voted by 303 to 296 in favour of an amendment to the finance bill tabled by Labour's Yvette Cooper to curb some of the government's tax administration powers in the event of no deal without explicit authorisation for parliament.
As Ireland Prime Minister Leo Varadkar stepped up efforts within the EU to help May gain the support to pass the agreement, fervent Brexiteer Boris Johnson reiterated his opposition to the agreement, insisting that leaving the EU without a deal would be the "closest to what people actually voted for" in the 2016 EU referendum.
"This vote is an important step to prevent a no-deal Brexit".
"Don't let the search for the ideal Brexit be the enemy of the good", May said, a reference to the criticisms of hardline Brexiteers and EU supporters such as former European Commissioner Peter Mandelson, who argue the deal undermines British sovereignty and should be rejected.
The EU executive repeated on Monday that leaders would not renegotiate the treaty and said it was pressing on with planning for Britain to crash out of the Union without a deal. "The government is attempting to force parliament to panic by refusing to take no deal off the table".
Theresa May has been trying to push her Brexit deal through Parliament.
Debate on the deal is set to begin on Wednesday, with the vote due in the week beginning January 14.
With a raft of other legislation still needing to be approved before Brexit day, that signals further difficulties for the government if it pursues a no-deal exit.
"The backstop remains the poison which makes any vote for the Withdrawal Agreement so toxic", DUP Deputy Leader Nigel Dodds said in a statement on Sunday.More news: Domestic violence charges dropped against Reuben Foster
The Prime Minister, who spoke to six European leaders including French President Emmanuel Macron and German Chancellor Angela Merkel over the Christmas holiday, said the government was "continuing to work on further assurances" on the issue of the controversial Irish border backstop.
With less than three months until Britain leaves the EU, May is struggling to win approval for her Brexit deal.
Meanwhile, Business Secretary Greg Clark told the House of Commons that a no-deal Brexit "should not be contemplated".
The prime minister was forced to abandon plans to hold a vote on the deal in December after more than a hundred Conservative MPs and the Democratic Unionist Party, which props up May's minority government, vowed to vote against it.
May's government has repeatedly warned that a no deal will lead to severe economic disruption, and Monday's exercise was part of preparations to ensure essential supplies can keep flowing through Dover, Europe's busiest ferry port.
"These are political assurances but there's nothing more we can do".
As a former home secretary, she warned that the United Kingdom would be "less safe as a country" under a no-deal Brexit.
"Nobody should be underestimating at this stage how likely a no deal exit could be", he said.
The EU, for its part, has insisted that the withdrawal agreement can not be renegotiated but has made clear the backstop is meant only as a temporary measure of last resort.
More than 100 Tories vowed to join with Labour to defeat May's deal, prompting her to go back to Brussels to get guarantees the backstop would only ever be a temporary measure.