For 90 minutes it was an emotional rollercoaster which every Aberdeen fan wanted to get off.
A fourth defeat in a row loomed for the Dons at Dundee as their Betfred Cup hopes were in danger of being ended by the Championship side.
But one desperate swing of Andy Considine’s boot hauled the Dons level in injury time before Sam Cosgrove’s header in extra time sent his side through to the last eight of the competition.
No wonder his watching manager felt like a fan again.
The Dons boss said: “Our fans were put through the mill.
“They came here with high expectations and it wasn’t playing out as they expected.
“We have to credit Dundee for that.
“You just become like a supporter.
“You just feel that elation and relief, and it was relief and sheer pleasure on my part at seeing my players having to dig deep and winning.”
McInnes handed Craig Bryson his first start for the club in place of the suspended Lewis Ferguson in the only change from Thursday’s Europa League defeat against HNK Rijeka in the Europa League.
Rangers winger Josh McPake, who watched the game at Dens Park ahead of completing his loan move to Dundee, saw his new side line-up without new signing Kane Hemmings who missed out due to injury.
Aberdeen had been stung by their European exit and they made a bright start at Dens with Niall McGinn cutting in from the left wing before seeing his shot blocked by Jordan McGhee but it was the first and last time they came close to threatening Jack Hamilton’s goal.
It was the Championship side which looked the more threatening.
The energy of their five-man midfield unsettled the Dons, and Danny Johnson and Josh Todd both came close to giving Dundee the lead.
Aberdeen were struggling to get going and the energetic approach of the home side almost brought the opener in the 23rd minute as they won the ball in midfield before Jamie Ness played the ball up to Johnson.
The forward turned Considine on the edge of the box and fired in a low shot which beat Joe Lewis but came back off the goalkeeper’s left post.
Funso Ojo was then involved in a penalty appeal as home players wanted a spot kick awarded for handball as he went to clear a Cammy Kerr cross but the home side’s work rate and energy finally paid off just before the break.
Considine was the guilty party, hauling Dark Blues defender Jordon Forster to the ground and referee Willie Collum had no hesitation in pointing to the spot.
Johnson stepped up to send Joe Lewis the wrong way to give his side a deserved half-time lead and the boos from the disillusioned 3,000 members of the away support told the story.
It had been dreadful.
Aberdeen had to respond after such a poor first 45 minutes and they at least got within shooting distance of Hamilton’s goal after Jon Gallagher found Sam Cosgrove in the box but the striker fired wide.
Gallagher had been the one player to match the energy levels of the home team in the first half and he looked the most likely route to Aberdeen getting back into the tie in the second half.
He found Ryan Hedges in the box but the Wales international’s effort was blocked by McGhee.
The ball broke back to Gallagher but he fired straight at Hamilton.
Gallagher went close again seven minutes from time with a header from a deflected Connor McLennan shot but Forster got back to hook his effort off the line.
Aberdeen looked to be running out ideas but they mustered one last chance in injury time to take the tie to extra-time.
Ojo crossed for Greg Leigh who saw his header saved by Hamilton but the ball broke to Gallagher who fired a low driven cross back across goal where Considine was on hand to score from a yard out.
Dundee were crestfallen while the Dons knew they had gotten out of jail with their late goal but they wasted little time in ensuring they made the most of their second chance in extra- time.
Sam Cosgrove, who had barely had sight of goal all afternoon, took the one chance which came his way as he beat Hamilton with a fine header from Leigh’s cross.
No wonder his manager was celebrating on the touchline.