There is some very good evidence for captured Muslims who were sold as slaves, but continued to practice their faith.
Perhaps the best known individuals were Ayuba Suleiman Diallo, who was enslaved in the eighteenth century and Omar ibn Said who was transported to the US in 1807.
Like many Muslims who were enslaved and transported to America as slaves, Ayuba Suleiman Diallo was an educated man.
He was enslaved in 1731, bought by a plantation owner named Tolsey in Maryland, and sent to work on a tobacco plantation.
Diallo was bought out of slavery by public subscription in England in 1733. As noted in the brief history of his life on the website of the National Portrait Gallery:
Through the publication of his Memoirs in 1734, Diallo had an important and lasting impact on Britain’s understanding of West African culture, black identity and Islam. In the early years of the nineteenth-century, advocates of the abolition of slavery would cite Diallo as a key figure in asserting the moral rights and humanity of black people.
Diallo returned to his home of Bondu in Senegal in 1734. A letter, probably written while Diallo was a slave, is held by the British Library, and formed part of a public display a few years ago.
Omar ibn Said was an Islamic scholar, born in Senegal, who was captured and enslaved in 1807, and who remained a slave for the rest of his life:
Despite this, he was able to write an autobiography in the 1830s (and also a number of Islamic manuscripts which are now part of the collections of the Wilson Library, University of North Carolina), meaning that he is possibly the best-documented example of a practising Muslim slave in the US.
Said died in 1864.
A relatively recent translation of Said's autobiography, which includes facsimiles of the original manuscript was published by the University of Wisconsin in 2011.
A couple of recent texts have looked at this topic in more detail:
are good examples.