The Titans trailed 28-12 at halftime at Robina but veteran Foran, in his 318th and final game before retirement, was magnificent to give his beloved coach Hasler an outgoing victory.
The win took Gold Coast off the bottom of the ladder and they will avoid the wooden spoon if Parramatta beat Newcastle on Sunday.
The Titans also unearthed a future star with teenage forward Cooper Bai shining off the bench.
The Tigers appeared in control after 40 minutes.
Titans half Jayden Campbell then scored after halftime with a typical opportunist effort. The star playmaker set up the next with a bomb and winger Brian Kelly finished it off.
The stadium erupted two minutes later when Kelly roared down the left touchline and put second-rower Beau Fermor over for a stunning 30-28 lead.
AJ Brimson, switched to the centres, sliced through for a third try in eight minutes and it was all over.
Hasler gave Queensland U19s sensation Bai his debut and the young forward made a barnstorming run with his first touch and then had a try disallowed. The son of Melbourne Storm legend Marcus Bai looks set for a long career.
Former Wallabies playmaker Carter Gordon made his Titans debut in the centres and had a tough initiation. His strength with the ball in hand was clear but he will take time to adjust to defending as a centre in the NRL.
The Tigers took the lead through the althleticism and skill of fullback Jahream Bula who leapt high to snaffle a Jarome Luai bomb.
Winger Heamasi Makasini, just 18 and on debut, finished with aplomb in the corner.
It was a wonderful moment for the young Tigers pathway graduate who will go back to school on Monday
Foran was clearly determined to finish his career was an elite display. He was heavily involved from the start with a line break and his passing game.
It was a Foran pass to Brimson that was finished off with a scheming run.
Brimson's switch to centre allowed livewire Keano Kini to return to his favoured fullback position. He was a real handful with his elusive running.
Foran and Kini combined to put Kelly over in the corner.
Tigers bench prop Royce Hunt scored twice in the space of four minutes.
Halves Jarome Luai and Latu Fainu were superb with the latter darting over on the cusp of halftime for a 28-12 lead.
Fainu left the field in the second half with a shoulder injury as the Titans stormed home.