Inverness captain rose to head home Greg Tansey's free-kick to ensure the visitors left St Mirren Park with the victory.
Chances were limited throughout the match but Saints had gone closest during the first half - Ryan Esson producing two wonderful stops from Jeroen Tesselaar and Steven Thompson.
St Mirren's final home match of the season also marked Hugh Murray's final appearance at St Mirren Park after 16 years' service.
Inverness showed an attacking threat in the opening minute when Gregory Tade glanced Graeme Shinnie's corner just wide.
Tade was involved a minute later when he raced on to Foran's through-ball but his touch let him down under pressure from Craig Samson.
The visitors continued to enjoy the majority of the attacking play as Shinnie forced Samson into an excellent stop with his powerful right-footed effort.
Darren McGregor's long-range drive in the 12th minute drifted well past the post, as St Mirren finally managed their first effort on goal.
Murray was brought on after 32 minutes to replace Dougie Imrie and the Saints fans appeared to be lifted by his introduction.
It was Inverness who continued to look the more likely to break the deadlock though and Aaron Doran troubled Samson from range before Shinnie's half-volley was eventually gathered at the second attempt.
Two wonderful stops by Esson five minutes before the break prevented the home side grabbing the lead. The former Aberdeen goalkeeper tipped over Tesselaar's dipping effort from the edge of the box and then from the resulting corner he produced a point-blank save from Thompson's header.
Paul McGowan failed to trouble Esson with a curling effort in the opening minute of the second half.
Inverness responded at the other end and Samson was relieved to see Tade flagged for offside after failing to handle Jonny Hayes' shot.
Saints continued to look for an attacking spark and Gary Teale replaced Nigel Hasselbaink after 52 minutes.
Teale became the first player to be booked after hauling down Nick Ross.
Foran met Hayes' delivery from the resulting free-kick at the far post but was adjudged to have strayed offside.
Thompson shot straight at Esson and then Tansey failed to hit the target after good work by Tade.
Murray tried to mark his final appearance at St Mirren Park with a goal but his powerful volley was bravely blocked by Roman Golobart, and the game appeared to be heading for a dull stalemate until the visitors broke the deadlock with five minutes remaining.
Tade was fouled on the edge of the area by Marc McAusland and Foran rose to nod in Tansey's set-piece.
The hosts threw men forward in the closing stages in an attempt to force an equaliser but Inverness comfortably held out to win their win final away encounter of the season.