Besiktas beat Kasimpasa 3-2 at the Vodafone Park stadium in the Super Lig on Thursday.
The Istanbul giants headed into the game needing a win to move into 3rd place and got off to a great start.
Tyler Boyd opened the scoring for the home side on 7 minutes but Koita bagged a brace with goals on 21 and 29 minutes to put the visitors ahead.
READ: Arsenal midfielder pay dispute with Besiktas intensifies again, Elneny may have played last game for Istanbul giants
Besiktas equalised on 49 minutes when Lens found the back of the net but it looked like the game would end in a draw until Guven Yalcin scored a last-gasp winner.
🔥🔥🔥🔥90' Güven Yalçın
Beşiktaş 3-2 Kasımpaşa
— @goalforza'yı takip ediniz. (@canligol_tv) July 9, 2020
The Black Eagles managed to overtake reigning champions Galatasaray and move into 4th place in the process.
Besiktas closed the gap with 3rd placed Sivasspor to just a single point.
The Black Whites will book a place in the Champions League should they secure a 3rd placed finish as Trabzonspor have been suspended from European competition.
The top two in the Super Lig usually qualify for the Champions League, considering Basaksehir and Trabzonspor will finish first and second – unless the Black Sea based side completely implode and lose their final three games.
Besiktas will play Yeni Malatyaspor next on Monday 13 July.