Inverness came back from two goals down to claim an unlikely win against an impressive Falkirk side.
Anthony Stokes opened the scoring on 41 minutes when he collected a Latapy pass and fired through Brown's legs.
The Bairns striker made it 2-0 in 51 minutes as the visitors threatened to run away with the game.
But the hosts hit back with a Craig Dargo goal, before Rankin fired home two free-kicks in the last 10 minutes to clinch the three points.
With nine wins from their last 13 visits to the Caledonian Stadium, the visitors were in confident mood.
The early stages of the encounter saw the Bairns, with veteran midfielder Russell Latapy playing in a more advanced role, playing some neat one-touch football and moving the ball around in impressive style.
However, for all their possession, Falkirk found the Caley rearguard organised and resolute, protecting keeper Mark Brown from any meaningful activity.
Latapy latched onto an Stokes knock-down after 11 minutes to fire a shot from 25 yards over the bar.
In the 18th minute Latapy fired his 30-yard free-kick inches past Brown's right-hand post.
Caley midfielder Barry Wilson tested Falkirk keeper Scott Higgins with a free-kick from a similar distance.
Falkirk opened the scoring on 41 minutes with a lovely counter-attacking move.
Latapy shrugged off the tenacious Ian Black in the centre-circle before sending Stokes scurrying down the right.
The Falkirk striker shrugged off Dods' challenge at the edge of the box before driving his shot through Brown's legs from about 12 yards.
Stokes got his second of the game in the 51st minute, after Latapy's mazy run left him with an easy tap-in as the visitors threatened to run riot.
The home side's comeback began after 70 minutes, when Rankin's corner from the right was flapped at by Higgins and Dargo stooped to headed home off the crossbar.
Karl Dodd fouled Wyness 25 yards out with eight minutes remaining.
Rankin curled in a wonderful shot from the resulting free-kick.
Then, after Stephen O'Donnell had clumsily clattered into Ross Tokely 35 yards out, Rankin scored an incredible second free-kick, curling his effort over the Falkirk goalkeeper.
Inverness CT: Brown, Tokely, Dods, Munro, Hastings (Wyness 57),
Wilson, Black, Rankin, McBain (Hart 57), Bayne, Dargo (Duncan 90).
Subs Not Used: Fraser, McCaffrey, Sutherland, McAllister.
Booked: Wilson, Dargo.
Goals: Dargo 70, Rankin 82, 86.
Falkirk: Higgins, Barr, Dodd (Gow 90), Milne, Ross, Thomson,
Cregg, O'Donnell (John Stewart 90), Twaddle, Latapy, Stokes.
Subs Not Used: Lambers, Moutinho, Lima, Craig, Scobbie.
Booked: O'Donnell, Dodd.
Goals: Stokes 41, 51.
Ref: S Dougal.