Two late tries tries have seen the Sharks escape with a 28-16 win over the Cowboys in a spirited contest at Southern Cross Group Stadium.
Retiring Cowboys legend Jonathan Thurston had the chance to level the scores with five to go, only for his conversion event to be waved away, with a four-pointed to Josh Dugan, followed by a try on the siren to Jayson Bukuya, sealing the result for the Sharks.
Just minutes earlier it was an Andrew Fifita try which put the Sharks in front, with the win a valuable one in their push for a top four berth.
The Sharks had appeared to post first points seven minutes in, but when the referee ruled Paul Gallen had obstructed a defender, the good work from Matt Moylan to reach out and score went unrewarded.
They wouldn't have to wait too long however to get on the board, Luke Lewis running a strong line and scoring off a smart Chad Townsend pass, with a long Valentine Holmes line break putting the Sharks into an attacking field position.
Holmes added the extras and the Sharks led 6-0 after 15 minutes.
A bad defensive read on the Sharks line saw Thurston put Coen Hess over in the south-western corner of Southern Cross Group Stadium and despite the conversion attempt being waved away, it was 6-4 with 18 minutes of the match gone.
Neither side was able to cross the line however six minutes before the break Thurston levelled the scores following a penalty against the Sharks for a play-the-ball indiscretion, then it looked as though the Sharks would then take the lead seconds before the half time siren, only a Holmes try to be disallowed for another alleged obstruction.
The 6-6 scoreline at the interval was probably a fair indication of the match, with the Sharks having it all to do, especially without strike centre Jesse Ramien who limped off midway through the half with an ankle problem.
Making matters worse for the Sharks, Ricky Leutele failed to come out for the second half after suffering a knee injury but the home side would strike first, this time it was Townsend slicing through on the second play following a kick error by North Queensland fullback Te Maire Martin.
The kick at goal from Holmes was good and the Sharks were up by six 10-minutes into the half.
From that point there was a big momentum shift and the next period of the match was all Cowboys, with the Sharks forced to defend consecutive sets of six on their line but finally they would break, Jordan McLean crashing through from close range.
Thurston evened the ledger and it was 12-all with 15 minutes remaining.
A strong defensive and a shallow kick from the Cowboys put the Cronulla side on the attack, then following a failed intercept attempt the Sharks had another set of six on their opponents line.
It was the only invitation they needed during a second half where they had been starved on the ball, with Andrew Fifita crashing over next to the uprights to score a try not all that dissimilar to his Grand Final winning effort in 2016.
Townsend chipped over the kick and it was 18-12 with a little over 10 minutes left.
The Cowboys however weren't done and when Gavin Cooper went short side to score in the north-western corner, Thurston had the chance to level the game once again with a kick from the sideline.
The kick sailed wide and it was still the Sharks at 18-16 with 73 minutes gone, with a grandstand finish assured.
The Sharks then looked to have sealed the result, however Holmes was dragged down inches short, then Dugan appeared to have won the match only for the try to be denied by the video referee.
A penalty in the lead up to the Dugan no-try, with John Asiata sin-binned, and the Sharks were still on the attack, this time Dugan making no mistake, busting through the line with a determined run, before Bukuya, playing on the right wing in the absence of his two injured outside backs, stepped over wide out.
It was an important win and one that puts the Sharks back in the frame for a top four finish to the season.
The Sharks are back on deck next Sunday when they host the Newcastle Knights in a match that will be the last at Southern Cross Group Stadium for Luke Lewis and a handful of other departing players.
Luke Lewis, Andrew Fifita, Chad Townsend, Jayson Bukuya, Josh Dugan tries, Valentine Holmes 4 goals
Coen Hess, Jordan McLean, Gavin Cooper tries, Jonathan Thurston 2 goals