In an article for The Daily Telegraph, Mr Gyimah said he could not support an agreement which would hand sovereignty to Brussels, leaving Britain “poorer, less secure and weaker in the pursuit of our national interests”.
He becomes the seventh minister to resign from the Government since Mrs May unveiled the draft Withdrawal Agreement two weeks ago.
With scores of Tory MPs now publicly opposed to the deal, his departure highlighted the scale of the task the Prime Minister faces if she is to win the crunch vote in the Commons on December 11.
Like Jo Johnson, who quit as transport minister, Mr Gyimah backed Remain in the referendum, underlining the fact that opposition to the deal comes from both the Leave and Remain wings of the party.
In his article, Mr Gyimah said that if MPs were to support the agreement it would “set ourselves up for failure” by surrendering “our voice, our vote and our veto”.
“Britain will end up worse off, transformed from rule makers into rule takers. It is a democratic deficit and a loss of sovereignty the public will rightly never accept,” he said.
“It has become increasingly clear to me that the proposed deal is not in the British national interest, and that to vote for this deal is to set ourselves up for failure. We will be losing, not taking control of our national destiny.”
Downing Street confirmed that his letter had been received and said there would be a response “in due course”.
Earlier, Mrs May, in Argentina for the G20 summit, brushed off questions over whether she would resign if she was defeated in the Commons.
“I have been asked these sorts of questions before,” she told reporters.
“I’m tempted to think the price of coming on one of these trips is asking questions about my future, because they come up every time and my answers aren’t going to change.”
However, the latest ministerial resignation by an MP who was among her early supporters for the leadership leaves her looking increasingly exposed.
Mr Gyimah’s announcement came as Mrs May disclosed she had given up efforts to gain access to the EU’s Galileo satellite navigation system for defence and critical national infrastructure purposes, after being frozen out by Brussels because of Brexit.
She confirmed the UK would instead aim to build its own Global Navigation Satellite System, at a cost estimated by independent experts at £3-£5 billion.
“Given the Commission’s decision to bar the UK from being fully involved in developing all aspects of Galileo, it is only right that we find alternatives,” she said.
“I cannot let our armed services depend on a system we cannot be sure of. That would not be in our national interest.”
Mr Gyimah said the Prime Minister had been right to call time on a negotiation which had been “stacked against us” for the start and offered a foretaste of what was to come under the terms of her agreement.
He said her “compromise” Brexit plan would not bring the country back together as she hoped and he urged her not to “dismiss out of hand” the option of a second referendum.
“What is being presented to the public as a sensible compromise Brexit deal, a 52/48 Brexit as some call it, will not bring closure or heal the divisions of Brexit,” he said.
“In the fullness of time, the public will wake up to what this so-called deal entails; neither leave nor remain voters will be pleased with a deal that leaves us poorer, less secure and weaker in the pursuit of our national interests.”
There was some welcome support for the Prime Minister from Environment Secretary Michael Gove - one of the leaders of the Leave campaign - who urged Tory Brexiteers to get behind the agreement.
In an article for the Daily Mail, he warned that Brexit could be “in peril” if the agreement was voted down.
“Does the deal deliver 100% of what I wanted? No. But then we didn’t win 100% of the vote ... you can’t always get everything that you want,” he wrote.
However, former education secretary Justine Greening, a prominent supporter of the People’s Vote campaign for a second referendum, said Mr Gyimah’s resignation offered further proof that Mrs May’s deal was not the right solution.
“Like many MPs he has recognised the huge shortcomings of the Prime Minister’s deal and the need to find an alternative path forward for Britain,” she said.
“His comments on the second referendum simply reflect the real choice confronting many MPs. He recognises trusting the people may be, in the end, the only way to break the gridlock in Parliament.”