I believe that it was originally a magnificent Hindu temple (Tejo Mahalaja, or some such spelling) dating from centuries before, appropriated by the Muslims (in precisely the same way the Muslims took over what was for centuries the largest Christian church in the world, the Hagia Sophia or Church of the Holy Wisdom in Constantinople), and deliberately made the Taj into a grave for one of the Shah's many wives as a direct insult to the Hindus, for whom the Muslims have the utmost contempt.
I would never give the Muslims any credit for the achievements of others.
There may or may not have been a Hindu temple on the site at one time, but the Taj Mahal was built new in the 1630s.