Dundee United needed a spot kick in stoppage time from Zac Sapsford to deny Stirling Albion a draw that would have taken their Premier Sports Cup group-stage opener to a bonus point penalty shoot-out.
The League 2 hosts, now managed by Steven Whittaker, looked destined to be rewarded for a battling, backs-to-the-wall performance.
Time and again, they put bodies on the line, even losing summer signing and new captain Josh Mullin to a first-half head knock as he made a last-ditch challenge.
However, visiting manager Jim Goodwin introduced 16-year-old academy product Cohen Leiper with 20 minutes to go and the winger helped secure the victory.
Taking on his marker at every opportunity, Leiper whipped in a cross that was met by Sapsford just before the striker was taken down by defender Sam Denham.
The Australian dusted himself down and sealed the victory from the penalty spot.