Genoa activated their obligation to buy Sturaro from Juventus for €16.5million in February, less than two weeks after he joined on loan and he marked his first appearance of his second spell with the opener after 72 minutes.
That was followed nine minutes from time by Pandev's fine strike past Mattia Perin to secure a deserved victory for the hosts.
Cristiano Ronaldo was rested after his midweek heroics against Atletico Madrid and Juve sorely missed his attacking threat in what was an insipid display.
Genoa came close to taking a surprise lead after 15 minutes but Perin showed superb reactions to paw away Antonio Sanabria's powerful drive from 12 yards.
The hosts then had a penalty award overturned by VAR on the half-hour mark after Christian Kouame was deemed to have handled the ball before it struck Joao Cancelo's wrist.
Juve thought they had taken the lead with their first shot on target after 55 minutes through Paulo Dybala. Referee Marco Di Bello was instructed by VAR, however, that there had been an offside in the build-up and the goal was ruled out.
The hosts took full advantage of that reprieve in a dramatic final 20 minutes.
Just moments after replacing Darko Lazovic, Sturaro sent a curling effort into Perin's bottom corner from 20 yards, which the Juve goalkeeper will feel he should have done better with.
Things got even better for the hosts in the 81st minute when Pandev collected Kouame's pass and fizzed a low strike past Perin.
Allegri's side scarcely looked like clawing their way back into the game in the closing stages and could end the weekend with their lead at the summit cut to 15 points if Napoli overcome Udinese later on Sunday.
What does it mean? Juve show a rare fragility
They have swept aside all before them in Serie A this season but the Bianconeri looked utterly bereft of inspiration and fight against a superior Genoa side. It will be a worry for Allegri that his team looked so lacklustre in attack without Ronaldo, while he might have some restless nights wondering what Ajax's exciting band of youngsters could do to that creaking defence in the Champions League quarter-finals.
Sturaro haunts old side
The 26-year-old endured a frustrating five years at Juve, scoring just three goals and being farmed out on multiple loans. He did not take long to reacquaint himself with the Genoa fans, whipping in the opener to set up a famous win.
Dybala fails to impress
Given the chance to shine in the absence of Ronaldo, the Argentina international struggled to make an impact against a resolute Genoa defence. His disallowed goal means he has still scored just four times in the league this season – a woeful return in a team that has utterly dominated Serie A.
Key Opta facts
- Juventus lost their first Serie A game since April 2018 (0-1 v Napoli).
- The last two teams to have been unbeaten against Juventus in a single Serie A campaign are from Genoa (Genoa this season and Sampdoria in 2012/13).
- Juventus have lost a Serie A away game for the first time since November 2017, also at the Ferraris, against Sampdoria (2-3).
- Juventus failed to have a single shot on target in a Serie A game for the first time since May 2018 (v Roma).
- Stefano Sturaro scored in Serie A for the first time since November 2015 (v Palermo).
Juve host struggling Empoli after the international break, while Genoa travel to Udinese.