The game pitted Messi against his Barcelona teammate Luis Suarez, and it looked as though the Uruguayan had gotten the better of him as he scored one goal and set up another to give his team a 2-1 lead going into injury time.
But a ball into the box was handled by a Uruguayan defender, and Messi calmly slotted the resulting penalty home to ensure an engaging friendly ended all square.
The 32-year-old had earlier teed up Manchester City striker Sergio Aguero to make it 1-1, after Edinson Cavani had opened the scoring.
Suarez scored a free-kick from outside the box to give his side the lead before Messi's late intervention.
The game had been dubbed by organizers as an important moment for Israel, following the cancellation of another Argentina match a year earlier after pressure from pro-Palestinian campaigners.
Organizers dubbed it as a game about peace, but boycott campaigners called for it to be cancelled over Israel's treatment of the Palestinians.
In the build-up to the game Uruguay coach Oscar Tabarez said he had been "very worried" about the game after a flare up between Israel and militant groups in neighboring Gaza last week.
The IDF said around 450 rockets were fired at its territory during the fighting and air defenses intercepted dozens of them in mid-flight.
A ceasefire was declared on Thursday but remains fragile.
Sylvan Adams, an Israeli-Canadian businessman whose financial backing ensured the match was held in Israel, said he hoped to show another side of the Jewish state.
"In bringing perhaps the world's most famous athlete, Lionel Messi, to Israel, we are providing excitement for the entire country - for Muslim, Christian and Jewish citizens of Israel," he said in a statement to AFP. "This is the 'normal' Israel that I know and love."
On the pitch at times it felt like the Messi show, with the crowd chanting his name and every mazy run greeted by vociferous cheering.
While not at his electric best, he showed moments of quality -- slaloming past defenders and forcing Uruguay goalkeeper Martin Campana into a number of smart saves.
The match comes after the cancellation of a pre-World Cup friendly fixture between Argentina and Israel in June 2018 after boycott calls.
That match had been due to be played in Jerusalem, sparking Palestinian anger and criticism of Argentina online.
Messi has now scored in both games since a three-month international suspension for comments he made after Argentina were eliminated from the Copa America in July.
He accused CONMEBOL, the governing body of South American football, of corruption and fixing the tournament for hosts and eventual winners Brazil.
He returned to the national team on Friday, scoring the winning goal in a 1-0 victory over Brazil.