Alli joined the Turkish club on loan from Everton following a failed move to the Toffees from Tottenham.
It was the first time for more than a year that the midfielder had scored a league goal.
That was for Spurs back in August 2021, netting against Wolves in a 1-0 win.
Even after joining Everton on loan in January, he failed to find the net in 11 Premier League appearances.
He joined Besiktas in August in the hope of revitalising his career and it has been a promising start.
Alli showed flashes of brilliance in his first game, nutmegging an opponent and going on a mazy run.
Now in his second game he found the net, the second in a 3-2 win for Besiktas.
Giorgi Beridze's 26th-minute strike gave Ankaragucu the lead, with Jackson Muleka equalising a few moments later.
Then came Alli's goal before Beridze got a second to bring the match to level terms again.
Former Tottenham player Georges-Kevin Nkoudou then found a second half winner.
There was a fiery end to the match with a red card for either team, before a hooligan then ran on the pitch to attack Besiktas players.
The assailant attempted to land a kung-fu kick on Salih Ucan, but former Everton and Crystal Palace player Cenk Tosun was caught up in the attack, with the supporter then bundled to the floor.