Let's take a look at exactly what we are taking into consideration here:
all Scriptures are quoted from the King James translation.
Exo 20:3 through 5
Thou shalt have no other gods before me. Thou shalt not make unto thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth: Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;
This commandment says 'gods before me.' There are two important points here:
the word is gods and the little g indicates a false god.
The second important point is the word before.
Considering these words and their importance how does that compare to what Naaman said, and verse 18 cannot be considered without considering verse 17:
2nd Kings 5:17 And Naaman said, Shall there not then, I pray thee, be given to thy servant two mules' burden of earth? for thy servant will henceforth offer neither burnt offering nor sacrifice unto other gods, but unto the LORD.
Naaman, wanted to have a place where he could feel like he was worshiping in Israel therefore he wanted some soil from Israel to build a worship place dedicated to the Jehovah, and stated that from then on he would worship him alone
2nd Kings 5:18 In this thing the LORD pardon thy servant, that when my master goeth into the house of Rimmon to worship there, and he leaneth on my hand, and I bow myself in the house of Rimmon: when I bow down myself in the house of Rimmon, the LORD pardon thy servant in this thing.
Here Naaman is saying that he will only be bowing in the house of Rimmon because his master (who might be infirmed) was leaning on his arm and it was his duty to aid his master in his worship.
It is noteworthy that Naaman brought this up to Elisha, and shows that he wanted to know if God would consider it sinful. And would not God have had Elisha warn Naaman not to if he was asking out of such concern.