The 5th prohibition is that we are forbidden from bowing down to an idol. Our usage of the term, "idol," of course includes serving anything other than G‑d.
The source of this commandment is G‑d's statement (exalted be He), "Do not bow down to them or serve them." [The phrase] "do not bow down to them," does not mean that only bowing down is prohibited, and nothing else. Rather, just one of the customary types of worship — namely, bowing down — is mentioned, and the same applies to bringing an offering or incense. One who transgresses any of these by bowing down, bringing a sacrifice, a wine libation, or incense is put to death by stoning.
In the words of the Mechilta, "The verse, 'Whoever sacrifices to any deity [other than G‑d alone] must be condemned to death,' teaches us the punishment but not the prohibition itself. The Torah therefore says, 'Do not bow down to their gods or serve them.' Sacrifices are already included [in the more general phrase, 'serve them.' Why is it singled out?] It is singled out to teach us that just as sacrificing is one of the ways of serving G‑d, and one is guilty whether this is the customary way of serving [the idol] or not; so too any similar type of service of G‑d, one is guilty whether it is a customary way or serving [the idol] or not."
The explanation of this is that there are four ways in which we are required to serve the exalted G‑d — i.e. bowing down, slaughtering, burning incense and pouring a wine libation. Anyone who serves an idol in one of [these four ways] is punished with death by stoning, even if that idol is not customarily served in one of these ways. This is called, lo k'darkah ["not in its way"], i.e. even though one did not serve the idol in a way in which it is customarily served, since one served in one of these [four] ways, he is punished by stoning if he did so intentionally, and kares if [the court] was unaware or he wasn't punished. If he did so unintentionally, he must bring a sin offering. One who accepts anything as a god is also guilty.
This prohibition — against performing one of these four types of service even if it is not the customary manner — has been repeated in G‑d's statement (exalted be He), "The Israelites shall no longer sacrifice to the s'irim." In the words of the Sifra, "The term s'irim refers to demons." Tractate Zevachim explains that this prohibition refers to one who slaughters [an animal] to an idol, even if the idol is not customarily served by slaughtering. Our Sages said, "What is the source of the law that one who slaughters an animal to Merkulis is guilty? From the verse, 'The Israelites shall no longer sacrifice to the s'irim.' If this verse is not needed to teach us the prohibition of serving the idol in the customary fashion — [because we already know this] from the verse, 'Now how did these nations worship their gods?' — it must teach us about serving it in a way which is not customary."
One who transgresses this prohibition intentionally is punished by kares or death by stoning, as we have explained; if he did so unintentionally, he must bring a sacrifice. In the words of Scripture,"Whoever sacrifices to any deity [other than G‑d alone] must be condemned to death."
The details of this mitzvah have been explained in the seventh chapter of Sanhedrin.