I'll try to answer your question. The Ottomans lose in the War or Sacred League/Holy Alliance mostly because they must confront a better-organized, financed, and more determined enemies in a multi-front war, the first time in their century and a half as a fully-established power beyond the Danube rather than any technological or military backwardness. They must face the Austrians, Poles, and the German Princes in Central Europe, Venice in the Aegean, Dalmatia, and Morea, and the Russians in the Northern Black Sea region, whose participation also discouraged their Crimean Tatar allies from giving further assistance. No contemporary state in the 17th Century could wage a war on four frontiers simultaneously, and the Ottomans were no exception as the war stretched their military and economic capabilities to its limits.
There are also several problems in the Ottoman army following the disastrous defeat at Vienna. First is the damaged morale because of aftershocks of an unforeseen defeat and the seemingly narrow loss of a spectacular victory. However, reviving a beaten army wasn't a main problem compared to the second problem, the crisis concerning the Ottoman command. Everybody within the Ottoman government and military began to look for scapegoats. Mustafa Pasha executed several generals in order to cover his failures, but without success. Then rival interest groups managed to convince Mehmed IV to execute Mustafa Pasha, which was duly done, leaving the beaten army without a commander and so effective strategic and operational leadership. Even so, in the time of such crisis the Ottomans managed to score several victories of their own like in Parkany (1683), Belgrade, Nis, Kacanik (1690), Lugos (1695), and Bega (1696). On military advancements, the Ottomans also followed close to their European rivals. They had adopted volley fire as early as 1605, expanded their musket-bearing infantry force to face the balance the superior firepower of the Austrian army, and utilizing mobile artillery, trading of diminished firepower for greater manoeuvrability just like European armies at the time.
Sources:
A Military History of The Ottomans by Mesut Uyar
Ottoman Warfare 1500-1700 by Rhoads Murphey