The Cowboys now advance to face Parramatta in Saturday's semifinal at ANZ Stadium, while the Sharks are the latest premiers to fall short of back-to-back titles.
Despite having James Maloney sin-binned for a professional foul in the first half, the Sharks twice had an eight-point lead.
Up 8-6 with 20 minutes remaining, Cronulla's title hopes hung on a knife's edge when they were incorrectly awarded a fifth-tackle penalty. Sharks centre Jack Bird then latched on to a Chad Townsend grubber in the ensuing set, and Maloney kicked their lead out to eight from the sideline.
However, the Cowboys refused to roll over and set up a grandstand finish in regular time for the 16,115 crowd.
With the Cowboys' season on the line, Kiwis forward Jason Taumalolo stunned the home side by carrying four defenders over on a routine hit-up.
Trailing 14-12 with four minutes to go, the Cowboys drew level when the Sharks were controversially penalised for stripping the ball.
The defending premiers twice had a chance to steal the game in the final minute, however, James Maloney's field goal attempt was charged down and Paul Gallen lost the ball millimetres from the tryline, forcing the extra period.
The Sharks appeared headed for a comfortable 8-0 halftime break when Maloney was binned for a professional foul on Ethan Lowe.
The Cowboys second rower was chasing a Michael Morgan grubber but was held back by Maloney, and the referee had no hesitation in sending him from the field.
The penalty allowed Lowe to reduce the deficit to six points just before the break but the real penalty came when Kyle Feldt crossed in the 50th minute.
With Maloney waiting to re-enter the field, Morgan fired a long ball to Feldt to bring the Cowboys to within two points with half an hour to go.
Bird's return was felt minutes into the contest when he hustled Antonio Winterstein into the in-goal, forcing a turnover pounced on by Townsend.
A legal strip from Jayden Brailey on Scott Bolton led to a penalty goal seconds later but the 8-0 advantage remained until Maloney's brain snap.
- AAP