Marx's demographic numbers did not look right to me, so I consulted the Wikipedia page Demographic history of Jerusalem. Sure enough, Marx's numbers differ substantially from the numbers of the official 1851 census listed there. However, modulo a bit of round-off, they are a perfect match with the numbers given in this publication, which is also listed:
César Famin, Histoire de la rivalité et du protectorat des églises chrétiennes en Orient. Paris: Firmin Didot Frères 1853.
On p. 49 Famin states that the resident population of Jerusalem comprises about 15,500 souls, of which 8000 are Jews, 4000 are Muslims, and 3490 are Christians:
La population sédentaire de Jérusalem est d'environ 15,500 âmes:
Juifs: ................. 8,000
Musulmans ... 4,000
Chrétiens ....... 3,490
Total .............. 15,490
He then proceeds to give a numerical breakdown of the Christian population. On p. 50 he describes the Muslim population as follows:
Les musulmans, qui forment à peu près le quart des habitants de Jérusalem, sont ici les maîtres en toute chose. Cette population, composée de Turcs, d'Arabes et de Maures est rude aux chrétiens et aux juif
[My translation] "The Muslims, who make up slightly more than a quarter of the inhabitants of Jerusalem, are here the masters of the entire thing. This population, composed of Turks, Arabs, and Moors is harsh on Christians and Jews; [...]"
I conclude that Marx simply translated, somewhat freely, these two sentences from Famin's book into English, turning French "Maures" into English "Moors". According to my 1998 dead-tree edition of the Larousse Unabridged Dictionary French / English this matches modern usage.
The French Wikipedia defines Maures as follows:
Maures [...] désigne les habitants musulmans et arabo-berbères médiévaux d'Ibérie, de Sicile, de Malte et du Maghreb, et à l'origine, durant l'Antiquité, les populations berbères d'Afrique du Nord, tout particulièrement du Maghreb.; [...]
[Google Translation] " Moors […] refers to the medieval Muslim and Arab-Berber inhabitants of Iberia, Sicily, Malta and the Maghreb, and originally, during antiquity, the Berber populations of North Africa, particularly of the Maghreb.; [...] "
Marx's "Moors" thus denotes the population group from northwest Africa mentioned in the question.
In comments, @ccprog points to further corroborating evidence. A little further down from the section quoted in the question, Marx writes:
The Jews, however, are not natives, but from different and distant countries, and are only attracted to Jerusalem by the desire of inhabiting the Valley of Jehosaphat, and to die in the very places where the redemptor is to be expected.
“Attending their death,” says a French author, “they suffer and pray. Their regards turned to that mountain of Moriah, where once rose the temple of Solomon, and which they dare not approach, they shed tears on the misfortunes of Zion, and their dispersion over the world.”
This is a translation of contents found on pp. 54 & 55 of Famin's book:
Ces juifs, au surplus, appartiennent tous à diverses contrées lointaines,
et ne sont attirés à Jérusalem que par le désir d'y choisir leurs places
dans la vallée de Josaphat, et d'y mourir sur les lieux mêmes où la
résurrection doit les retrouver. En attendant la mort, ils souffrent et
ils prient ; ils pleurent sur les malheurs de Sien, sur leur dispersion dans le monde, les regards tournés vers ce mont Moriah où s'élevait jadis le temple de Salomon, et dont ils n'osent pas approcher : douleur immense dont le spectacle arrache souvent des larmes aux chrétiens eux-mêmes.