It is surprising that you approach this forum without making any effort yourself of reading and understanding relevant provisions in the Gratuity Act.
Any employee, irrespective of any number of years' past service joining you, you are not liable to pay gratuity for past service in any other organization. Had you taken trouble to read the provisions you would have got enlightened on this.
29th August 2018 From India, Mumbai
1st September 2018 From India, Hyderabad
As per your illustration Employee in question has received Gratuity from his First Employment consequent to putting 5 Years Service.Similarly in his Second Employment, he has not received Gratuity because he has put in only 4 Years Service
Your liability of Payment of Gratuity arises consequent to completion of 5 Years of Service in your Establishment
2nd September 2018 From India, New Delhi