There is a legend that says that one day the sage Narada Muni, brought a golden mango to the home of Lord Shiva, and prayed that he eat it . The lord gave the fruit to his consort Goddess Parvathi and asked her to eat it. The fruit was a rare one and was the fruit of wisdom, Parvathi wanted her sons Lord Ganpathi and Lord Muruga to eat it. The problem was the fruit has to be eaten fully to gain its benefits and that meant only one of her children could have it.
Lord Shiva came up with the idea of a contest between his two children and said that the child who goes round the world three times and comes back here first will truly deserve the fruit and so will be rewarded with it.
At once Lord Muruga got on his peacock and flew determined to win the fruit. Lord Ganesha whose vehicle is the mouse knew it was futile to try and beat his younger brother if he sets out on his mouse and tries to go around the world. He does beat his brother to the fruit ! He goes three times around his parents who were seated and declared that since his parents were his whole world he has gone around the world thrice, his amused father gave away the fruit to him.
Lord Muruga came back sure of his victory, and was greatly taken aback seeing the fruit in the hands of Lord Ganesha . In a fit of anger he renounced his family and climbed up a hill and remained there. His loving parents Lord Shiva and Parvathi came to pacify him and said that he was the fruit of wisdom(Nyana pazlum)- Palani. The place thereon came to be called Palani.