Ba, who scored seven goals in 12 games for the Hammers, has taken to Twitter to wish the club's newly appointed manager Slaven Bilic well.
The 30-year-old striker was signed by Bilic for Besiktas last year and went on to score 18 goals in 29 games for the Turkish side.
Bilic departed the club at the end of the Super Lig season and was announced as West Ham's new boss on Tuesday.
The news went down well with his former striker, who has been linked with his own return to London at Crystal Palace by TalkSport, and he has posted a message to the former Croatia boss online.
Tweeting out a link to the West Ham website's official announcement, Ba said: "Congrats boss. All the best in your new challenge!"
Gongrats boss. All the best in your new challenge...!https://t.co/laRRFmcNhn— Demba Ba (@dembabafoot) June 9, 2015
Aside from the fact they worked together at Besiktas, Ba and Bilic's time in East London share a number of similarities.
Bilic quickly become a fans' favourite with his passionate and skilful defensive displays for the Irons, but just when Hammers fans had taken him to their hearts he left the club for Everton in pursuit of "a better chance to win trophies."
Ba was signed by the Hammers in the January transfer window of 2011 with the club staring relegation in the face under the hapless Avram Grant.
He too wasted little time endearing himself to the West Ham faithful, scoring seven goals in 12 games. But it was to end in tears as the Hammers were relegated on the final day and Ba departed for Newcastle United shortly after.
The Paris-born Senegal star had proved a steal for co-owners David Sullivan and David Gold as they signed him on a pay as you play basis due to knee problems picked up during a medical at Stoke City a few weeks before.
There were clearly no ill-effects, though, as he almost single-handedly saved the Hammers from relegation to the Championship. He would later play for West Ham's London rivals Chelsea before his move to Turkey, flourishing under Bilic.