What you are probably seeing is not a pipe slotted into another but the overflow pipe joint socket which does give that appearance as to sealing go with Rich t as that would be my answer without removing and refixing. Normally these joints are soldered with plumbers Solvent glue. But sealant should work also.
I suspect its an old unit as most nowadays the overflow is built into the cistern so runs in to the toilet pan instead of on the floor. I would be worth getting the syphone unit changed as well and the water inlet valve as the washer may have worn and still allowing water through. You can do a search on the internet to see how various types of work. Type in the search engine 'Types of cistern syphon's and how they work'.
Bob
March 2014