Where in international law does it say that a country is required to have a relationship next to it? Israel withdrew from the Gaza Strip in 2005. Now, Gaza being a separate territory from Israel (although the situation still requires Israel to provide it with all its electricity and water), Israel has no obligation to let Gazans into Israel or anything from Israel into Gaza. A country is allowed to decide who and what comes through its borders (see: passports, customs protocols, etc.). Gaza shares a border with a Egypt as well, they could get everything they need if Egypt was willing to cooperate with them and help them (the Egyptian monarchy dislike Hamas, the terrorist organization which now controls Gaza, because they are an offshoot of the Muslim Brotherhood, which challenges the Egyptian government).
Think of it this way: If today, for whatever reason (immigration, drugs, etc,), the United States decided to close its borders to Mexicans and any good from Mexico, would that be illegal? Of course not. Mexico is a foreign territory, and the US can deny its people or goods if it wants to. Israel has simply closed its border with Gaza- and there is nothing illegal about it.
As a side note: there are just as many Palestinians living in Israel (about 1.5 million) as in Gaza. They live with Israeli passports, vote in elections, and have 14 representatives in the Israeli Knesset (Parliament).