Both sides were locked at 0-0 as the full time whistle blew.
However Rangers dug deep and a thunderbolt from Ryan Jack in the 94th minute before fellow substitute Scott Wright fired in a second took the trophy back to Ibrox for the first time since 2009, winning 2-0.