Najib, who entered via the Rafah crossing from Egypt with Foreign Minister Anifah Aman and other officials, was met by Palestinian Prime Minister Ismail Haniya.
Speaking shortly after his arrival, Najib said his visit was intended "to show solidarity and our support for the struggle of the Palestinian people."
"We may come from thousands of miles away ... but we are one Umma (Muslim nation) and we believe in the struggle of the Palestinian people," he said.
Najib also expressed support for renewed reconciliation efforts between the Islamist movement Hamas and the rival Fatah party, including attempts to form a consensus government to pave the way for new elections.
Amid criticism of his visit from Fatah, he said a unity government would be a good "response" to Israeli elections which were under way on Tuesday and seen ushering in a more hardline rightwing government.
"We believe in this unity government and we pray to Allah that the talks will be successful and a united government will become a reality in the near future," Najib said.
Haniya commented on the vote, warning that "the trend of the Israeli elections suggests a move from an extremist government to a more extreme government."
"This requires us as Palestinians, and Arabs, and Muslims, to build a unified strategy to confront rising Zionist extremism."
Najib also visited Gaza City's Shifa hospital and the parliament building, and laid the first stone at a Malaysian-funded school before leaving for Egypt.
His visit is the latest in a string of high-profile trips to Gaza, following a trip last October by Qatar's Emir Sheikh Hamad bin Khalifa Al-Thani, who became the first head of state to visit the strip since Hamas took control in 2007.
During the November conflict, a delegation of Arab foreign ministers, along with Turkish Foreign Minister Ahmet Davutoglu, visited Gaza on a solidarity mission.
And on February 9, Tunisian President Moncef Marzouki is scheduled to make his first trip to the coastal strip, according to Hamas officials.
The visits have been made possible in part by Egypt's decision to loosen some of the restrictions on travel through its Rafah border crossing with Gaza, the only entry point to bypass the Occupied Territories.