Messi drew level with Pele's tally of 643 goals for Santos with a lunging header on the stroke of halftime in Barcelona's 2-2 home draw with Valencia in La Liga on Saturday.
"When your heart overflows with love, it is difficult to change your path," Pele said in an Instagram post. "Like you, I know what it's like to love wearing the same shirt every day. Like you, I know that there is nothing better than the place we feel at home.
Read Also: Messi fit for World Cup qualifiers, says Argentina boss
"Congratulations on your historic record, Lionel. But above all, congratulations on your beautiful career at Barcelona. Stories like ours, of loving the same club for so long, unfortunately, will be increasingly rare in football. I admire you very much."
While Messi achieved the feat in 748 matches, Pele needed only 665 games to reach the figure.
Read Also: Lionel Messi staying with Barcelona this season
Pele, the only player to have won the World Cup three times, holds the Guinness world record for most goals in a career with 1,283, including friendlies.
Now 80, Pele played for Santos from 1956 to 1974 before ending his career with the New York Cosmos. He is Brazil's all-time highest scorer with 77 goals in 92 international matches from 1957 to 1971.
Messi, 33, has scored 71 times in 142 appearances for Argentina and is also his country's most prolific scorer.
Read Also: Messi’s father arrives in Barcelona to discuss son’s future