The goal was the fastest goal by a substitute in this Süper Lig campaign and also marked the Senegalese internationals 17th league goal.
Ba has now scored 17 league goals in a single season for the first time in his career.
The 29-year-old striker is currently the second highest goalscorer in the league after Bursaspor forward Fernandao.
The Senegalese international has a total of 25 goals and seven assists in all competitions for the Black Eagles since joining from Chelsea in the summer.
The win over Trabzonspor ended the Black Sea Storms six game winning streak at home.
The defeat ended Trabzonspor’s best home run in a league campaign since 2012.
Beşiktaş moved back into first place, overtaking Fenerbahçe who temporarily topped the Süper Lig table following the 4-3 win over last placed Balıkesirspor.