The military said the tank responded to shots fired at soldiers from the post.
But Hamas said its fighters were taking part in a live-fire exercise and that israel would pay for their deaths.
The incident comes as the UN and Egypt continue to try to broker a deal for a lasting ceasefire between israel and Hamas, which dominates Gaza.
A video released by the Israeli military shows two men in a watchtower, said to be in northern Gaza, and puffs of smoke as one appears to open fire. It then cuts to footage of a shell hitting the post and an explosion.
Hamas’s military wing, the Izz al-Din Qassam Brigades, confirmed two of its members were killed, but said the border post was hit during an “exhibition” by a naval commando unit that was being watched by several Hamas leaders.
“The resistance cannot allow the occupation to impose a policy of bombing sites and targeting fighters without paying the price,” a Hamas statement said.
The Israeli military said none of its troops was injured, but warned that it was prepared to “target any aggression against Israel and holds Hamas responsible for everything happening in and emanating from the Gaza Strip”.