Prop Sam Tagataese produced a barnstorming run on what should have been the sixth tackle - before a some splendid Todd Carney vision resulted in Ryan crossing out wide.
It was the perfect reply after a Feki knock-on handed the Cowboys a close-range scrum from which they worked a brilliant play for Brent Tate to go over untouched.
Ben Pomeroy put the Sharks in front for the first time when he crossed off the back of the brilliant Michael Gordon and, as the game wore on, the Cowboys progressively looked further and further out of the contest.
Then up stepped Wayne Ulugia - who dropped the ball over the line in the first half - to change the complexion of the game, snatching a Carney pass and racing 95 metres to lock it up at 12-12.
Jason Taumalolo crossed seven minutes later and the Cowboys were back in front, but the Sharks fought back with Tagataese going over after Luke Lewis and Gordon combined to get Cronulla within striking distance.
Gordon missed a conversion he should have made and the Sharks trailed 18-16 and, despite Carney clearly hampered by his dodgy hamstring, they went over again when an ugly Jeff Robson pass found Feki.
There was still life in the Cowboys, who stopped the clock at 41 seconds near their own line when they packed a quick scrum.
They marched downfield and looked like they had stolen it at the death - Cecchin awarding the try to Linnett only for the replay to show John Morris had pushed his leg over the sideline in an epic finish.