The obscure 22-year-old Ukrainian was playing in a title match for the first time in his six-year career on the men's tour.
The 209th-ranked Stakhovsky's previous tournament best was a quarterfinal loss to Sweden's Robin Soderling at a 2005 event in Milan, Italy.
He only got into the tournament because France's Michael Llodra withdrew at the last minute and is the first lucky qualifier loser to win an ATP tournament since Argentina's Christian Miniussi at Sao Paolo in 1991.
Ljubicic, playing before a partisan home crowd, was appearing in his 20th final and third straight in Zagreb.
The Croat won the inaugural event in 2006 and lost the final in 2007 to Cypriot Marcos Baghdatis.