Substitute Hasani had already served warning of his goal threat with a superb free-kick that crashed against Brad Jones' crossbar.
And the Macedonia international’s slaloming run and classy finish in the 91st minute ultimately proved the difference at Brondby Stadion.
Liverpool vice-captain and Denmark skipper Daniel Agger was the main focus of attention before the game upon his return to his first club, but Philippe Coutinho and Jordon Ibe shone brightest for the Premier League outfit on the pitch.
Despite Brondby's superior match sharpness - this was the Danes' fourth pre-season game - it was Liverpool who started the better, with Coutinho a constant menace.
However, a superb 20-yard effort from Christian Norgaard gave the hosts the lead in the 23rd minute, shortly after Liverpool youngster Tiago Ilori had limped off injured.
Brondby keeper Lucas Hradecky then made fine saves from Coutinho, Brad Smith and Lucas Leiva, but a searing run down the left from teenager Ibe - brought on at half-time - led to Kristoffer Peterson equalising from close range.
Riza Durmisi and Hasani both hit the woodwork with free-kicks as the home side unsurprisingly finished the stronger, yet the latter was not to be denied in stoppage time as he fired home to earn Brondby the win.