According to IMDB, Keaton and Chaplin were rivals at first, but consolidated their relationship when Keaton's career declined:
He and Buster Keaton had an interesting relationship. Long considered rivals but always having avoided commenting about each other in the press, Chaplin hired Keaton for a part in Limelight (1952). Keaton, who was flat broke at the time, went into a career decline after having been signed by MGM in 1928, as the studio would not let him improvise in any of his films nor allow him any writing or directorial input, and he was eventually reduced to writing gags - often uncredited - for other comedians' films. Chaplin, at this point, felt sorry for Keaton due to his hard luck, but Keaton recognized that, despite Charlie's better fortune and far greater wealth, Chaplin was (strangely) the more depressed of the two. In one scene in "Limelight", Chaplin's character was dying. While the camera was fading away, Keaton was muttering to Chaplin without moving his lips, "That's it, good, wait, don't move, wait, good, we're through." In his autobiography Keaton called Chaplin "the greatest silent comedian of all time".
source
So while they probably never became friends, they seem to at least had professional respect for one another, which is indicated by Chaplin inviting Keaton to his movie and Keaton's acknowledgment of Chaplin's performance.