BEIRUT—The Trump administration is in talks with Arab allies about having them form a military alliance that would share intelligence with Israel to help counter their mutual foe, Iran, several Middle Eastern officials said.

The alliance would include countries such as Saudi Arabia and the United Arab Emirates that are avowed enemies of Israel, as well as Egypt and Jordan, which have longstanding peace treaties with Israel, five officials from Arab countries involved in the discussions said. Other Arab countries could also...