The panel of 11 judges added Israel has to support relief efforts provided by the United Nations in the Gaza Strip, and UN entities, including UNRWA, the United Nations Relief and Works Agency for Palestine Refugees in the Near East.
"As an occupying power, Israel is obliged to ensure the basic needs of the local population, including the supplies essential for their survival," presiding judge Yuji Iwasawa said on Wednesday. He added that basic needs include food, water, shelter, fuel and medical services.
Advisory opinions of the ICJ, also known as the World Court, carry legal and political weight, but they are not binding and the court has no enforcement power.
UN Secretary-General Antonio Guterres welcomed the advisory opinion and urged Israel "to comply with its obligations" in accordance with the opinion, his spokesman Stephane Dujarric said in a statement.
"The impact of this Opinion will be decisive to improve the tragic situation in Gaza," Dujarric said.
The opinion, which was requested by the UN General Assembly in December, clarified the protections states must provide for UN staff and is expected to have effects beyond the Gaza conflict.
In a post on X, Israel's foreign ministry said it categorically rejected the court's findings and added "Israel fully upholds its obligations under international law". Israel banned UNRWA from operating in Gaza last year, claiming that some of its employees were members of the militant group Hamas or other affiliated associations. The ministry said that the United Nations had yet to fully probe the extent of Hamas involvement in UNRWA, and said Israel would not cooperate "with an organisation that is infested with terror activities".
The ICJ judges on Wednesday found that Israel had not substantiated its claims that a significant number of UNRWA employees are Hamas members.
In April, lawyers for the United Nations and Palestinian representatives at the ICJ accused Israel of breaking international law by refusing to let aid into Gaza between March and May, a time when Israel completely cut off all goods, accusing Hamas fighters of stealing aid.
Since then, some humanitarian aid has been allowed in but UN officials say it was nowhere near what was needed to ease a humanitarian disaster which crossed the threshold into famine. A ceasefire agreed this month calls for Israel to admit 600 trucks of aid per day, but the UN says far less is entering so far.
The ICJ opinion found Palestinians in Gaza were inadequately supplied and stressed Israel cannot use starvation as a weapon of war.
UNRWA, which serves millions of Palestinians by running schools and aid distribution, employs more than 30,000 people.