In Europe, the discussion has played out largely on social media, where some commentators have lambasted Europe for hypocrisy for its different approaches to the wars in Ukraine and Gaza, while few politicians have commented directly.

Carl Bildt, the former Swedish prime minister, wrote on X, formerly Twitter, that most of the world perceives a double standard in Western policy on the two wars. “Rightly or wrongly, this is something we must deal with,” he wrote.

There are signs of that happening now. Josep Borrell Fontelles, the European Union’s top diplomat, said in a speech to the European Parliament on Wednesday that cutting off water supplies was a violation of international law no matter where it happened. “It is clearly stated that depriving a human community under siege of a basic water supply is contrary to international law — in Ukraine and in Gaza,” he said.

Some analysts suggested that hostility toward Western policy in Ukraine in certain corners of the world should be taken as a given but that it could still be dealt with tactfully.

During the Cold War, the United States often faced a hostile bloc of nonaligned nations, as well as the Soviet Union and its allies, and still managed to prevail, said John Herbst, a former U.S. envoy to Ukraine as well as a diplomat in Israel and the occupied territories, currently with the Atlantic Council.

The Gaza conflict may make winning support for Ukraine “marginally more difficult,” he said, but by no means impossible.

Israel’s goal of uprooting Hamas is probably too ambitious, he said, but it can greatly weaken Hamas’s military capability. The United States will take a hit in global public opinion for its support of Israel in the short term, but that will probably fade over time, he predicted, and should not dissuade Washington from continuing to make its case on Ukraine.

“We should explain that what Moscow is doing in Ukraine is dangerous for all nations because if the type of international order that the Kremlin is pursuing, and that Beijing is pursuing, becomes the international order, that means that all small, comparatively weak states would be at the mercy of their larger neighbors,” Mr. Herbst said.

Vivian Yee contributed reporting. Sheelagh McNeill contributed research.