Israel's military confirmed that it targeted an observation post, calling the attack retaliation for a bomb that had been placed next to the border fence overnight.
The Gazan health ministry identified those killed as Hussein al-Amour, 25, and Abdul Haleem al-Naqa, 28.
A day earlier, Israeli aircraft attacked two targets belonging to the Hamas movement, although no casualties were reported.
Defence Minister Avigdor Liberman said in a statement the barrier would deny the Hamas militant group another strategic capability.
Since then, Israel has been preparing for possible attacks by sea by Hamas, especially as the IDF has improved its ability to detect and destroy Hamas tunnels under the fence separating the Gaza Strip from Israel.
Israel Defence Minister on Sunday announced that construction had begun on a marine barrier with the Gaza Strip extending into the Mediterranean Sea.
In the hours leading up to the inauguration of the embassy in al-Quds on May 14, Israeli troops engaged in clashes with Palestinian protesters, killing over 60 unarmed demonstrators and wounding more than 2,700 others, either through direct shooting or firing tear gas canisters.
'Brainstorm or Green Needle?' is the new, even weirder, 'Laurel or Yanny?'
A video featuring US President Donald Trump and White House staff received millions of views when it was posted to Twitter today. Vice President Mike Pence also made an appearance - but was confused by audio clip.
No injuries were reported either from local sources or the IDF.
According to Gaza medical officials, more than 115 Palestinians have so far lost their lives by Israeli fire since the border rallies began in late March.
Tuesday's Gaza flotilla will coincide with the 8th anniversary of an Israeli attack on the Turkish "Mavi Marmara" flotilla, in which nine Turkish activists were killed when the Israeli navy attacked the vessel in worldwide waters.
Low-level demonstrations along the border have continued since protests peaked on 14 May, when at least 61 Palestinians died while tens of thousands of Gazans protested as the USA moved its embassy to Jerusalem from Tel Aviv.
Israel says it is defending its border as well as its communities nearby.
It accuses Hamas, with whom it has fought three wars since 2008, of seeking to use the protests as cover to carry out violence.