In a statement, the Interior Ministry said the two men had been found guilty of communicating with “hostile foreign parties”, a reference to Israel.
In one case, the information allegedly led to the “targeting and martyrdom of citizens”, while another was accused of providing information on “resisters, their places of residence, many of their jobs, places of launching rockets and blacksmith shops”.
The other three people executed were convicted of murder. The five executions announced on Sunday bring to 33 the total number of executions by Hamas since the group seized power in the coastal enclave in 2007.
The Interior Ministry in Gaza said the executions took place “after all levels of litigation have been exhausted” and that “the convicted have full rights to defend themselves in accordance with judicial procedures”.
It is unclear what form the trials took.
The last time Hamas was known to execute people accused of collaborating with Israel, in April 2017, human rights group Amnesty International called their trials “unfair proceedings before military courts”.