Yoga is in religion, but religion is not in Yoga. The principles of Yoga are (in alphabetical order) in Buddhism, Christianity, Hinduism, Islam, Jainism, Judaism, Sikhism, and most of the other religions. However, unlike religions, Yoga itself has no deity, worship services, rituals, sacred icons, creed, confession, clergy, institutions, congregation, membership procedure, or system of temples or churches. The word “Yoga” means “union” referring to the direct experience of the wholeness of ourselves at all levels. While the word “Yoga” comes from traditional Sanskrit language, that union is a universal process. The inner calling for that wholeness has also been called the “mystic” longing.
The yogis and mystics seek the esoteric end of the polarity of esoteric-exoteric. However, since the world of religions is dominated by the exoteric orthodoxy, the mystic and yogi is rarely understood. One who has been to the top of the spiritual mountain in direct experience may say, when asked what was discovered, “Yahweh; Ehyeh,” or “I am that I am.” He or she may say, “The father and I are one.” She or he may say, “Sohum” which is Sanskrit for “I am that.” He or she may go as far as to say, “I am God,” in the spirit that the wave and the ocean are one and the same. That direct experience aligns with the immanent end of the immanent-transcendent polarity, but not being understood, comes across as a threat to the religionists. As if that is not enough of a threat, the mystics and yogis seek to trace their way back to the original material cause, rather than myopically focus on a projected efficient cause.
Because of their direct experience of the esoteric, immanent, and material causes--rather than mere belief--the mystics and yogis who are unwilling to renounce that direct experience and pledge loyalty to the orthodox religious institutions and their leaders have been beaten, hung, shot, crucified, beheaded, burned at the stake, and otherwise murdered. They have been outright banished or coerced to leave the cities and communities of the fear-filled religionists so as to live alone in the deserts, forests, or high mountains. Modern religions, cultures, and even religion classes insist on categorizing and classifying the mystics and yogis, attempting to force them into rigid boxes of institutional religious identity.
It remains as true today as always, that the mystics and yogis prefer to remain invisible, outside of the mainstream view, as they live far outside the center of the bell curve called “most people.” Yet, the number of people with this level of deep longing for direct experience rather than mere blind faith is so large that there is an increasing need for higher visibility of the authentic mystics and yogis. As long as humanity is here, there will continue to be mystics and yogis longing for, seeking, and attaining the direct experience of the highest truth, self, reality, infinity, god, or whatever term one wants to use for that. The realized yogis and mystics drift here and there in our world so as to serve those few.
Obviously, not everybody (including those of West and East) agrees with the above, and very much see Yoga as religion.
Highly related to the question of whether yoga is in religion, or for that matter, whether yoga itself is a religion, is the very important question about what is the meaning of the word religion in the first place. Is the origin of yoga a religion called Hinduism, or does yoga stand alone, separate from exclusive identity with any religion? This is a controversial subject, and I am not going to try here to tell you the whole story, but rather to give you some leads if you want to pursue such questions, which I recommend you to do if you are serious about the origins and practice of traditional yoga.
The gist of this is that both Hinduism and the category of religion itself are fairly recent constructions, dating from approximately 1900CE. If this is so, then it is not fair to say that the often stated 5,000+ year old yoga tradition is synonymous with any of these modern religions. This is not to say that principles of yoga practice cannot be found in religion, which they certainly can, but it is not accurate to say that yoga is the property, so to speak, of a religion called Hinduism. Again, we can acknowledge that this is quite controversial. People who self-identify with Hinduism religion often strongly defend their views, as do most staunch religionists of all types.
A simple explanation about the construction of religion is in the Wikipedia article on Religion; here is the link. The footnotes of this article list several books that you may find very interesting. I have read quite a few of them and have found them to be quite useful.
Here are some of the books I have personally read and found useful: