Early tries from Luke Dyer and Ryan McGoldrick put the Tigers in command but Quins hit back to lead through converted scores from Paul Sykes and Danny Williams.
The moment of the match came shortly before the hour mark when 38-year-old Brad Davis - who came off the bench to make his first appearance since May - set up Fletcher?s try with a brilliant kick.
The success draws Terry Matterson?s side level with Quins on 19 points and leaves Wakefield as firm favourites to relinquish their top-flight status.
Neither Castleford nor Harlequins can yet consider themselves safe but both sides now lie three points above the Wildcats with just two games remaining.
The Australian had seen his team lose their previous four games but they quickly set out to put things right by opening the scoring from the second set of six in the third minute.
The Tigers had penned Quins back from the first whistle and a fine array of inter-passing saw the ball pass through four pairs of hands and culminated in Australian centre McGoldrick sending Dyer in at the left corner.
The otherwise flawless Danny Brough failed to land the goal but Castleford continued to dominate with Danny Sculthorpe making his presence felt up front with a series of thunderous challenges.
One such challenge during the opening exchanges left the former Wigan prop requiring treatment for a head injury yet it typified the Tigers? commitment to the cause.
Indeed, there was precious little respite for the Londoners during the opening quarter as Castleford sought to make their early dominance pay.
They did just that in the 19th minute when a delightful grubber kick from Sculthorpe was touched down by McGoldrick in the left corner.
But Castleford were stunned shortly before the half-hour mark when Chad Randall and Luke Dorn combined to send Sykes over from close range.
The score injected new-found belief into the visitors and in the 32nd minute they registered again when Rob Purdham expertly engineered the space before providing a delicate offload to Williams, who raced over.
Sykes converted both tries to edge Quins 12-10 ahead but Lupton?s converted try - awarded after deliberation from the video referee - put Castleford 16-12 ahead at the break.
And the Jungle erupted 10 minutes after the restart when Michael Shenton embarked on a surging run which took him deep into Harlequins territory.
He was held up but the subsequent pressure led to Manu crossing the line and three minutes later Davis entered the fray.
It was the evergreen scrum-half?s first appearance in three-and-a-half months following injury but he showed he has lost none of his class.
Within four minutes of his arrival, he displayed brilliant vision and perfect technique to send an exquisite kick into the right corner for Fletcher to touch down.
Brough failed to claim his fourth goal from five attempts but Sculthorpe?s late drop goal ensured Castleford ended the game on a high.
Castleford Tigers: Platt, A. Fletcher, Shenton, McGoldrick, Dyer, Lupton, Brough, Sculthorpe, Henderson, Nutley, Manu, Ward, R. Fletcher. Replacements: Bird, Viane, Fa?aoso, Davis.
Harlequins RL: McLinden, Stewart, Lucky Luisi, Smith, Bradley-Qalilawa, Sykes, Dorn, Mills, Randall, Heckenberg, Purdham, Hopkins, Paul. Replacements: Williams, Haumono, Noone, Budworth.
Castleford Tigers: (16) 27 Tries: Dyer, McGoldrick, Lupton, Manu, A. Fletcher. Goals: Brough 3. Drop Goals: Sculthorpe.
Harlequins RL: (12) 12 Tries: Sykes, Williams. Goals: Sykes 2.
Referee: P Bentham