Of the graves, 3007 are from World War I, the rest are from World War II.
Most of the soldiers buried in the cemetery are British with some from Australia, New Zealand and Canada. Soldiers from Egypt and Turkey are also buried there, with 30 post-war burials of United Nations peacekeepers and humanitarian workers.
Among the 23 New Zealanders are two members of the Maori Battalion, Privates Kamati and Tutavake. Kamati was 26 years old when he died in Gaza.
Another who died there was Ernest William Hobb, at the age of 38 in 1942.
He was awarded a distinguished conduct medal.
Ibrahim Jeradeh, 77, has been head caretaker of the cemetery for 57 years and officially retired as the head gardener when he was 65. He still watches over the site where he lives.
"I've met many New Zealanders who have come to visit the graves here. Some people come here on Anzac Day to remember the dead," he said.
Which is surprising given only diplomatic, humanitarian workers and journalists have been able to enter the Gaza Strip since 2006.
Gaza was bombarded by French warships in April 1915 and at the end of 1917 was attacked and surrounded by Egyptian forces in the first battle of Gaza. The earliest burials of soldiers were in 1917.
During World War II, Gaza was also an Australian hospital base, and the headquarters of the Australian Imperial Force.
The New Zealand Mounted Brigade involved 147 officers and 2897 other ranks based in Egypt as part of the Anzac Mounted Division.
In April 1916, it was deployed to the Sinai Peninsula where it took part in an unsuccessful Sinai and Palestine campaign against the Turks. New Zealanders fought in most battles leading up to the fall of Jerusalem and the defeat of the Ottoman Army, and were praised for their efforts alongside the Australian and British soldiers. A total of 17,723 New Zealanders served in this campaign and New Zealand casualties were 640 killed in action and 1146 injured.
The Gaza War Memorial is one of thousands paid for by the Commonwealth War Graves Commission.
The cemetery is not immune from the conflict between Israel and the Palestinians. In 2006, Israeli troops bulldozed the cemetery's perimeter wall and six of its headstones. An Israeli military helicopter also fired a cannon at one of the memorial stones.
Some of the headstones still bear pockmarks from attacks.