I read that in 1665 the Duke's Law made denying the "true God" punishable by death in New York. Would someone suspected of this receive a trial? Would it be public, or fair? If they were found guilty, what would be the method of execution? Was execution always the punishment?
In practice, probably nothing. The most obvious example of this is the Jewish community that already existed in New York City before 1665.
The first Jewish people came to the future United States in 1654, refugees from Brazil. They had been living in Mauritsstad (now part of Recife), which had been under Dutch control since the early 1600s. The Jewish population had immigrated there under Portuguese control, but under the Dutch, they were able to worship openly since the Dutch had a policy of religious tolerance by that point. The first synagogue in the Americas was established at Maurisstad in 1637.
But then the Portuguese recaptured the settlement, and fearing the inquisition, most of these Brazilian Jewish people left. Some of the group made their way back to Europe, and the group that ended up in New York are suspected to have had the same intention, but pirates robbed them of their valuables en route. They then convinced the ship's captain to take them to New Amsterdam. Initially, the Director-General of the New Netherland colony, Peter Stuyvesant, did not want to admit them, except as slaves, to repay the debts owed to the ship's captain and other debts owed.
Stuyvesant wrote to his superiors at the Dutch West India Company, and the de facto spokesman for these Jewish refugees, Asser Levy, wrote to the company, too, and the company sided with the Jewish people. Jews were allowed to openly worship in the Netherlands, and were also allowed to invest in the Dutch West India Company (which they did), and so the Company ordered Stuyvesant to admit the refugees "so long as they do not become a burden to the company or the community". Stuyvesant tried various other schemes to try to discourage the Jewish population from staying, but further petitions ultimately won the rights of the Jewish people to hold office and form a congregation, though not to build an actual synagogue. In 1656, the Jewish burial ground was established.
By the time the English took over the colony in 1664, rights for Jewish worship had been secured. One of the stipulations in the Articles of Capitulation was the right for the Dutch to worship however they pleased:
"The Dutch here shall enjoy the liberty of their consciences in Divine Worship and church worship."
While technically this only applied to members of the Dutch Reformed Church, according Civil Status of the Jews in Colonial America by Max T. Kohler, "[t]he effect of these terms would seem to be to continue the legal status of the Jewish residents as of old under the new order". Asser Levy and many of the other Jewish men swore the oath of allegiance to the King of England, and were allowed to practice their faith openly, hold office, engage in trade, and serve on juries.
This all followed events back in England that gave Jewish refugees there as well the informal right to worship, beginning with the Robles case under Oliver Cromwell. When Charles II regained the throne in 1665, there were efforts in England to prosecute the Jews, but he ended up protecting their rights. By 1673, the Jews in England were erecting their first synagogue.
They did face some discrimination in England, as detailed by The Jews of Britain, 1656 to 2000 by Todd M. Endelman. For instance, Jewish people could not hold certain professions or hold public office, since they required taking an oath that professed belief in a Christian god. They were also taxed at a higher rate. But some of these laws were repealed as the 17th Century went on, such as being able to give testimony in court cases by swearing on a Hebrew Bible.
Jewish people in New York faced similar types of discrimination, but none were ever seriously prosecuted for openly professing their faith. During James II's brief reign from 1685-88, it briefly got worse as he tried to establish England as a Catholic state, but this same discrimination was attempted to be enforced against all non-Catholics, and in the colonies, it didn't go much of anywhere. This ended with William and Mary taking the throne in 1688, whereupon the position of tolerance was reinstated. (William was a Dutch prince, and adhered to the Dutch policy of tolerance as there were further efforts by religious conservatives in England to bar open Jewish worship.)
Today's Congregation Shearith Israel in New York City traces their roots back to that original congregation of Brazilian Jewish refugees who landed in New Amsterdam in 1654. The congregation has met regularly since that time, though in private for their first several decades, when they were tolerated but not officially recognized. They eventually won the right to erect an actual synagogue in 1730, which was located on Mill Street, now 26 South William Street between Broad Street and Mill Lane. The congregation's synagogue has moved several times, but they have had a house of worship somewhere in New York City ever since 1730. The Plantation Act 1740 allowed for Jewish people living in the American colonies to be naturalized as British subjects.
Michael A. Gomez has written a study entitled "Muslims In New York" which sheds a bit of light on Muslim New Yorkers in the colonial period, but it's unfortunately, not as easy to make much of a statement one way or the other. Virtually every Muslim in America during the British colonial period was a slave from Africa, and there is little evidence that there was any open worship. But on the other hand, there is even less evidence they were persecuted in any way.
More generally, there were occasional efforts by the British authorities to establish the Anglican Church as the official religion in New York, but this never got much of anywhere. Despite the Articles of Capitulation of 1664, the English government almost immediately tried to tax the citizens in support of the Anglican Church, a tax that most New Yorkers refused to pay.
In 1684, the royal governor Thomas Dongan wrote to England that the official policy of establishing the Anglican Church as the official religion was a losing battle: "Here bee not many of the Church of England; few Roman Catholics; abundance of Quaker preacher men and Women especially; Singing Quakers; Ranting Quakers; Sabbatarians; Antisabbitarians; Some Anabaptists; some Independents, some Jews; in short of all sorts of opinions there are some, and the most part, of none at all." As such, the New York City government exempted the Dutch Calvinists from the Anglican church tax altogether, and the Lutherans shortly thereafter.
James II, issued "Secret Instructions to Gov. Donegan" in 1685 to stamp out all religions other than the Anglicans (which he was attempting to turn into a Catholic church). Leisler's Rebellion of 1689-90 resulted, a rebellion against the government by Dutch Calvinists, Lutherans, and other non-Anglican groups--and was actually successful and taking control of the colony for several months. When William and Mary took over, they issued "Secret Instructions to Governor [Henry] Sloughter," which granted "liberty of Conscience to all Persons (except Papists) [i.e., Roman Catholics], so they be contented with a quiet and Peaceable enjoyment of it, not giving offence or scandal to the government."
With the appointment of Edward Viscount Cornbury as the royal governor of New York in 1702, there was yet again another effort to establish the Anglican Church as the state religion and forbid open worship of other religions, which led to a riot in July 1702 of Presbyterians that made Cornbury's efforts de facto unenforceable.
In 1718, Daniel Bull and many of his neighbors in Jamaica, Queens, successfully protested another tax to support the Anglican church, "going so far as to intimidate the deputy constable with physical force."
As Thomas E. Carney summarizes his essay "A Tradition To Live By: New York Religious History 1624 to 1740":
"These events indicate that by the mid-eighteenth century, many (if not most) non-Anglicans in the province of New York held to an expectancy of religious freedom. This expectancy would later propel them to oppose the Anglican efforts to dominate the colony's first college, King's College, in the late 1750s, and to oppose the proposal for the appointment of an Anglican bishop in the North American colonies in the 1760s. In the end, this expectancy would rise to the level of a basic—constitutional—principle with the refusal of the framers of the first New York state constitution to prefer any religious denomination over any other."
While this was primarily an effort for religious freedom and tolerance among various Christian groups, non-Christians such as the New York Jewish community benefited as well. They were certainly discriminated against in some ways that Christians were not, but not to the extent that they were subject to trials or death. The discrimination amounted to lack of rights of other Englishmen, such as the ability to hold public office.
SOURCES:
"The Congregation Shearith Israel: An Historical Review" by N. Taylor Phillips, Publication of the American Jewish Historical Society, 1897
"Civil Status of the Jews in Colonial America" by Max T. Kohler, Publication of the American Jewish Historical Society, 1897
"Colonial Jewry: Religion, Domestic and Social Relations" by Doris Groshen Daniels, American Jewish Historical Quarterly, 1977
"Muslims in Early America" by Michael A. Gomez, Journal of Southern History, 1994
The Jews of Britain, 1656 to 2000 by Todd M. Endelman, 2002
"A Tradition To Live By: New York Religious History 1624 to 1740" by Thomas E. Carney, New York History, 2004