The Interior Ministry said Sunday that one will be executed by firing squad, while the other will be hanged.
The ministry said security forces seized $2 million in illicit drugs in January alone, which was equivalent to what was seized in all of 2016. Most of the seized drugs were narcotics and cannabis.
Marijuana and prescription painkillers have been flooding into the Gaza Strip, prompting officials from Hamas to seek tougher penalties for smuggling drugs.
Both convicted dealers were caught smuggling marijuana, opium and tramadol through tunnels under the border with Egypt, according to a list of their charges.
"Such actions represented a threat to Palestinian national security, with its economic and political dimensions," the court said.
Hamas has issued and implemented capital punishment mostly against people found guilty of murder or of collaborating with Israel. These verdicts were the first against drug dealers.
The defendants were previously given lighter sentences, but the ministry says the dealers "were not deterred."