There are a number of references to European mercenaries serving in various Muslim armies, but in most cases it is unclear whether any of them were knights and many of the examples are after the start of the Crusades.
However, one good example of Christian knights serving a Muslim ruler is this one
European mercenaries served in Muslim armies, notably in North Africa
and in the Middle east. For some years before 1147, there was a
company of Christian knights in Morocco who had their own clergy and
even a bishop. Christian mercenaries became one of the best fighting
forces in the Turkish army.
Source: Hunt Janin & Ursula Carlson, 'Mercenaries in Medieval and Renaissance Europe'
If one accepts El Cid (c.1043-1099) as a knight (he was certainly a noble and and C.M. Yonge claims that he was knighted by King Ferdinand I of Leon), then he would be another example:
The Spanish hero El Cid, having served as a mercenary captain for both
Christian and Muslim leaders....
Source: Hunt Janin & Ursula Carlson
The Wikipedia page on El Cid gives more details on this:
El Cid found work fighting for the Muslim rulers of Zaragoza, whom he defended from their traditional enemies, Aragon and Barcelona.
El Cid may have been involved in the Battle of Graus (1063) at which 300 Castilian knights fought on the side of Ahmad al-Muqtadir, ruler of the Islamic taifa of Zaragoza, against the Christian Ramiro I of Aragon. However, it is unclear if they were there as mercenaries or as allies.
Also in Spain, M. Florian in History of the Moors of Spain recounts the following (author's orginal spellings retained):
...in a battle which occurred A.D. 1010 between two Mussulman leaders, there were found among the slain a count of Urgel and three bishops of Catalonia...
Christian soldiers (unclear if this reference includes knights) serving a Muslim ruler prior to the Crusades is also mentioned by Hussein Fancy in The Mercenary Mediterranean
The use of Iberian Christian soldiers in Islamic armies was not
limited to the peninsula. The Almoravid ruler ‘Ali B. Yusuf Tashfin
(r. 1061 – 1106) was said to have first introduced the practice to
It may seem strange that Christian soldiers (knights or otherwise) at times fought for Muslim rulers, but we should be careful not to look at relationships between Christians and Muslims from the modern perspective. Although it is true that Christian soldiers were usually used when Muslim rulers were fighting each other rather than fighting Christians, the early spread of Islam into Christian lands was often welcomed as a relief from Byzantine rule for Muslim rulers tended to be tolerant. As Jane Smith notes:
Military expeditions were political in nature and not undertaken for the purpose of forcing conversion to Islam. Christians and Jews were given “dhimmi” status, paying a poll tax for their protection.
Further west, the ability of Muslims, Christians and Jews to live together in peace up to the 10th century is well-illustrated by Spain:
Certain periods in world history reflected harmonious interactions among the three Abrahamic faiths. Medieval Andalusia, for example, provided a venue for Muslims and Christians, along with Jews, to live in proximity and even mutual appreciation. It was a time of great opulence and achievement, and social intercourse at the upper levels was easy. It was also a period during which a number of Christians chose to convert to Islam. Medieval Andalusia has often been cited as an ideal place and time of interfaith harmony.
This did not continue, of course, but even so extremism was not prevalent at the time and in-fighting among both Christian and Muslim rulers was very common. In such cases, rulers looking for mercenaries were not necessarily going to be fussy about the religion of those they hired. Also, when the Normans became a power in southern Italy, it was at the expense of both Christian and Muslim rulers.
In fact, there was no guarantee even that a Christian ruler could trust a fellow Christian not to join forces with a Muslim army - note the career of Roussel of Bailleul whose treachery (first abandoning a Byzantine army to join a Muslim force in defeating his former ally and then later setting up an independent state) eventually led to his capture by the Seljuks and execution by the Byzantines (1077).
On a final note, the Romance of Gillion de Trazegnies, a medieval work of fiction, concerns a knight who commanded the sultan of Egypt’s army. Although fiction, the character is based on various knights of the period so there may well be some factual basis.
C. M. Yonge The Story of the Christians and Moors of Spain
S. Lane-Poole The Moors in Spain
Brian Todd Carey Warfare in the Medieval World
S. Runciman A History of the Crusades: vol 1