It said a third suspect was sentenced to hard labour.
Authorities have seized drugs with a street value of around USD 1 million over the past few months, the ministry said.
They seized 1,250 packets of cannabis and 400 pills of Tramadol - a powerful opiate-based painkiller - in January alone, it said.
All Palestinian death sentences in theory have to be approved by president Mahmoud Abbas, but Hamas has long refused to accept his legitimacy.
The Palestinian Centre for Human Rights (PCHR) said today's sentences were a "serious precedent" and that bringing civilians before a military court was a breach of Palestinian law.
It said that one of the two men was condemned to death by hanging and the other was to hang.
The PCHR said in an English-language statement that to carry out the sentences would be "extra-judicial killing, and those (who) participated or contributed to issuing them should be held accountable on grounds of extra-judicial killing and abuse of power".
"Applying this penalty in drugs cases is very dangerous, particularly in absence of fair trial guarantees and presence of many reports exposing widespread use of torture during the interrogation period, especially in drugs crimes," it added.
The centre said that around a dozen death sentences have been passed down in Gaza since the start of 2017.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)