Slaven Bilic changed formation to a 4-4-2 after bringing on Ba for Ghana international Daniel Opare on 57 minutes.
Just one minute later, Gökhan Töre made a well timed pass across the penalty area that found Ba.
The Senegalese international striker found the bottom corner with a powerful effort to open the scoring.
The 29-year-old also became the leading goalscorer – alongside Bursaspor forward Fernandao – in the league following his 17th Süper Lig goal.
The former Chelsea striker has now scored 26 goals in 40 appearance for Beşiktaş in all competitions. 17 in the league, 8 in Europe and 1 in the Turkish Cup.
The loss was Trabzonspor’s first at home since the turn of the year.
Beşiktaş moved into first place following the victory and will remain at the top of the table regardless of the result of the Galatasaray – Akhisar game.