The story of Vinayaka or Pillaiyar of that temple goes back to Ramayana times. When Vibheeshana was returning to Lanka after attending the coronation of Sri Rama he was supposed to have crossed this region. He was carrying the Murthy of Sri Ranganatha, the family deity of Sri Rama which was gifted to him by Rama. It was by the trick of Lord Vinayaka who appeared as a boy, the Murthy of Lord Ranganatha came to be permanently installed at that place which is Srirangam of today. There are references to Srirangam temple in Sangam literature thereby showing the antiquity of that lord. This Vinayaka's abode is this hill-top.
The connection of Lord Vinayaka temple at the hill top (Malai-k-kottai) of Trichy also known as Ucchi-p-pillaiyar temple to Srirangam temple thus is part and parcel of Trichy's Hindu culture and part of the Epic culture of India.