The deflected 25-yard free-kick with four minutes to go came immediately after Caley Thistle defender Chris Hogg was shown a straight red card.
Inverness dominated for much of the game and broke the deadlock after three minutes when David Davis curled home before Shaun Hutchinson levelled six minutes before the break.
Andrew Shinnie put Inverness back in front after 76 minutes but Keith Lasley lashed home an equaliser 60 seconds later.
Hateley then got the late winner to give Motherwell a three-point cushion over Celtic in second place and kept Caley Thistle at the foot of the table.
Defender Josh Meekings and forward Shane Sutherland made their first SPL starts of the season as Inverness made four changes to the side which was held to a 1-1 against Dunfermline in last week's basement battle at Tulloch Caledonian Stadium.
Defenders Hogg and Kenny Gillet also came in, with Thomas Piermayr and Graeme Shinnie dropped to the bench, while David Proctor and Nick Ross failed to make the squad.
Motherwell made one change to the side who settled for a goalless draw at home to Kilmarnock last time out with Hutchinson replacing Steve Jennings, who was not in the squad.
The home side when ahead when Davis curled home his first for Inverness after just three minutes.
Greg Tansey's free-kick was cleared to the edge of the area and the on-loan Wolves midfielder guided his 20-yard shot past Darren Randolph.
Full-back Steven Hammell forced a save from Caley Thistle goalkeeper Ryan Esson as the visitors hunted an equaliser.
Randolph was equal to Tansey's effort from the edge of the box as the hosts took charge.
Hammell was carried off after a clash with Meekings, with replacement Ross Forbes joining the action with just over an hour to go.
Shinnie was next to test Randolph with a neat turn and shot at the edge of the box after a Gregory Tade lay-off.
Tade set up Tansey moments later and his rasping effort was thwarted by Randolph at full stretch.
Hutchinson cashed in Motherwell's first real chance to level with a towering header from six yards after 39 minutes.
The defender rose well unmarked to power home Hateley's cross.
Moments later Jamie Murphy might have given the visitors the lead when his cross hit the bar and the same player flashed a shot wide in stoppage time.
Davis tried his luck again from 25 yards early in the second period but Hutchinson diverted it wide.
Sutherland ballooned an effort over after good work from Tade as Inverness took control once again.
Tade should have made the pressure count just before the hour when he smashed an angled six-yard shot onto the crossbar after a quick one-two with Shinnie.
Randolph saved from Shinnie but Caley Thistle failed to make their chances count.
Tade was next to be denied by Randolph when his thunderbolt through a ruck of bodies was palmed away.
It was the last contribution of the game for the French forward as he was replaced by influential midfielder Jonny Hayes, returning from a groin strain.
The Irishman had an immediate impact, setting up Shinnie to restore the hosts' lead after 76 minutes when he coolly slotted a low 12-yard shot past Randolph.
But Motherwell hit back a minute later when Lasley fired a rocket past Esson into the top corner from 30 yards.
Inverness were reduced to 10 men when Hogg was shown a straight red by referee Crawford Allan for felling Murphy when he was through on goal with seven minutes to go.
Hateley compounded the punishment by scoring directly from the resulting free-kick. The 25-yard effort was deflected past Esson to put Motherwell ahead.
The visitors held on at the end when Davis' low shot went a yard wide of the target.