Teenager Daniel MacKay struck two minutes from time to give Caley Thistle a vital 2-1 Betfred Cp victory over League 1 side Raith Rovers.
The match had looked destined for a penalty shoot-out after Grant Gillespie had cancelled out Nathan Austin’s opener for the Highlanders, 17-year-old substitute MacKay’s late strike proved decisive.
The goal ensures Inverness need a point from Sunday’s game against Hearts at Tynecastle to confirm their progress to the second round as Group C winners.
Caley Thistle made one change from the side that defeated Cowdenbeath 5-2 the previous week, with George Oakley brought in to replace Jordan White.
Inverness looked in control of the first half, but were unable to force a breakthrough, with their best chance arriving on 14 minutes when Nathan Austin set up strike partner Oakley for a low shot which was well saved by Robbie Thomson.
Caley Jags created another opportunity just four minutes later when Liam Polworth’s corner found its way to Tom Walsh, but he scooped his effort well over.
With chances few and far between in the first half, it took Caley Jags only four minutes to break the deadlock after the interval, as Oakley teed up Austin for a delightful low curling strike from 20 yards which nestled in Thomson’s bottom-right corner.
The lead lasted on 12 minutes however, with Raith equalising when Gillespie turned home Lewis Milne’s corner from close range.
Robertson brought on MacKay and Calder, with the pair combining to great effect on 88 minutes as Calder’s strike was parried by Thomson into the path of MacKay to tap home.