The visitors took the lead after only seven minutes when Andy Dorman pounced on a loose pass from Lionel Djebi-Zadi to slot the ball past Michael Fraser.
However, Caley equalised just before the break in spectacular fashion, with Filipe Morais rounding off a superb team move with an accurate finish from distance.
The Portuguese grabbed a second soon after the restart with a low strike from the edge of the box.
The result meant Caley leapfrogged St Mirren at the bottom of the table, although Gus MacPherson's side have a game in hand.
Caley made three changes on a wet and blustery day in the Highlands.
Fraser replaced the suspended Ryan Esson in goal for his first league start since November.
Morais and Brian Kerr also returned to the starting XI, with Russell Duncan and Adam Rooney dropping to the bench.
The visitors kept with the same XI that drew 0-0 with Hamilton, with Craig Dargo starting in attack against his former club.
The home side began in a positive manner, aiming to eradicate the memories of their 4-0 hammering at Falkirk in their last SPL outing.
Dougie Imrie volleyed over the bar within three minutes of the start, signalling their intent.
But it was the visitors who took the lead after only seven minutes thanks to a defensive lapse from Djebi-Zadi.
The Frenchman's loose pass fell straight into the path of Dorman who slotted the ball past Fraser for his eighth goal of the season.
Grant Munro almost grabbed an equaliser after 25 minutes when Imrie found the Caley captain with a deep corner but the defender's header was pushed wide by Mark Howard.
The final pass was letting the home side down when they got into the attacking third but Kerr threaded an intelligent ball through to Imrie, whose effort from distance fizzed wide after 33 minutes.
The Paisley side were continuing to press for a second, with Jack Ross linking up with Billy Mehmet before his effort was blocked by Richie Foran.
But with only five minutes of the half remaining, the home side levelled in spectacular fashion.
A superb passing move ended with Imrie finding Morais in space and the midfielder fired the ball past the helpless Howard from 25 yards.
Inverness came out of the traps flying and within two minutes of the restart got themselves in front.
Djebi-Zadi found Morais on the edge of the box and the Portuguese took a touch before driving the ball past Howard for his second of the game.
The home side were in the ascendancy now and David Proctor sent an enticing cross into the area but Foran's header flashed wide.
MacPherson made his first change of the day after 57 minutes when Gary Mason was replaced by Stephen McGinn. Veteran striker Jim Hamilton was introduced to the game soon after, with Garry Brady making way.
McGinn should have restored parity after 67 minutes but his glancing header from Mehmet's cross went harmlessly wide.
Inverness had a major let-off after 75 minutes when Fraser only managed to parry a low Hamilton effort to the advancing Dorman but, with the goal gaping, the midfielder smashed the ball off the crossbar.
David Barron came on for Mo Camara with 10 minutes to go as the away side went for broke before Inverness brought on defender Jamie Duff for the tiring Imrie.
There were a few nervy moments for the home support as the Buddies pressed for an equaliser but Caley held on for a vital win.