Inverness squandered the chance to secure a European spot after crashing to a last-gasp 2-1 defeat to Dundee United.
A win for Terry Butcher's side would have secured third place and the final Europa League berth.
But Aaron Doran's opener was cancelled out by Ryan Dow, before Gary Mackay-Steven struck in injury time to hand United their first post-split win.
The result means the race for Europe goes to the wire, with Inverness, St Johnstone and Ross County still in contention as it stands ahead of County's game against Motherwell.
Inverness were boosted by the return of David Raven from suspension for the crunch clash at the Tulloch Caledonian Stadium.
Johnny Russell made his first start for United in two-and-a-half months after recovering from a broken leg, while John Rankin also started despite fears over a knee injury.
The home side looked lively early on and could have been ahead when Nick Ross supplied the cross from the left and Andrew Shinnie's deflected effort bounced just past the post.
United had far less to play for than their hosts but indicated they were also up for this match when Stuart Armstrong collected Russell's back-heel pass and drew a decent save from Antonio Reguero with a powerful shot.
At the other end, Billy McKay tried his luck with an angled drive that fell across goal and, just when Doran looked set to stab home at the back post, Jon Daly managed to clear for a corner.
McKay was threatening again, this time with a volley that was tipped just wide by Radoslaw Cierzniak.
Daly then came to the rescue to block a ferocious shot from McKay, before then denying Doran as Inverness cranked up the pressure.
Butcher's men looked set to take the lead when referee Crawford Allan pointed to the spot after Raven was felled in the box by Rankin after 34 minutes.
McKay stepped up for the spot-kick but, for the second week in a row, failed to convert from 12 yards when Cierzniak saved well, seconds after being booked for dissent.
However, the United goalkeeper was plucking the ball out of the back of the net three minutes before the break when Raven teed up the shot for Doran and he rifled into the back of the net from the edge of the area.
The visitors were back on level terms four minutes after the restart when Flood's free-kick was nodded on for Dow to lash home his first SPL goal.
Doran volleyed over for Caley Thistle, before United squandered a great chance to find the back of the net again when Russell attempted a back-flick and missed the ball completely with the gaping net at his mercy.
Inverness piled forward in search of the goal that could seal their place in Europe and Andrew Shinnie blazed a desperate attempt over from just inside the box.
He then turned provider for McKay, who failed to connect properly a yard out at the near post under pressure from Brian McLean and the chance was lost.
A Ross cut-back then found Doran in an ideal position but he ballooned his shot over the stand completely.
Instead, they were hit with the sucker punch when United grabbed the winner in injury time when Mackay-Steven rifled home at the far post.
The outcome of this match left Caley needing a result at Dingwall in the Highland derby on the last day to claim third spot.