A Lachlan Coote field goal and a late Kyle Feldt try proved the difference as the Cowboys held on to pip the Panthers 23-18 at Pepper Stadium on Saturday night.
A couple of former Panthers proved the difference on the night, with Coote setting up two tries and slotting the winning field goal, while Gavin Cooper scored the try that tied the game with 15 minutes to play.
Jason Taumalolo continued his incredible 2015 with 207 metres in just 49 minutes, while Jake Granville provided a crucial spark from the bench.
Matt Scott was placed on report for a 'crusher' tackle on Merrin in the 63rd minute -his second such charge in 2016 – and faces a nervous wait leading into next week's clash with the Rabbitohs.
Peter Wallace made 51 tackles, while Merrin had his best game for the Panthers, scoring a try, running for 108 metres and delivering three offloads.
The five-point margin was the fifth game in a row involving the Panthers that had been decided by six points or fewer.
Buoyed by their last-gasp win over the Eels last week, the Panthers hit the ground running with two tries in the opening 15 minutes to stun the defending premiers.
Bryce Cartwright was in the thick of everything early on, playing a big part in both tries, with Dallin Watene-Zelezniak doing the rest.
The first came with a bit of luck, as a Coote grubber ricocheted off the Panthers back-rower, before Cartwright scooped up the loose ball.
From there, the Penrith No.11 linked up with Te Maire Martin who quickly offloaded to Watene-Zelezniak, before the winger dished it back to his five-eighth. Martin kept the play alive with another pass to DWZ, who fended away from Johnathan Thurston before touching down for one of the best tries of the year.
The combination on the right edge was at it again seven minutes later, with Cartwright taking advantage of a quick Waqa Blake play the ball to put his winger over for a first-half double.
The Panthers could have easily had a third try, but Coote managed to bundle Josh Mansour over the sideline.
That tackle seemed to spur the Cowboys into action, and it was the diminutive Cowboys No.1 who did the damage.
Against his former club, Coote set up two tries in the space of 10 minutes to completely change the momentum of the contest and give his side a two point lead at the break.
The first came on the back of a slick left-edge movement that ended with Coote putting Javid Bowen over for his second try in as many NRL games.
Coote showed he was just as good on the other side of the field, hitting right centre Justin O'Neill with a short ball to cross for his fourth try of the season.
The Panthers made a whopping 210 tackles in the first half, with Peter Wallace making 36 in a terrific defensive display.
Simple handling errors by Scott Bolton and Michael Morgan gifted the Panthers field position to start the second forty, but resolute defence from the Cowboys held the hosts at bay.
They might have survived the earlier raid, but back-to-back penalties proved too much for the Cowboys' defence to handle.
Continuing his dream run in the No.9 jersey, Wallace supplied Merrin with a well-timed pass to send the lock forward over for a very well-deserved four-pointer to give his side the lead.
A Jamie Soward penalty goal shortly after pushed Penrith's lead out to a converted try with 20 minutes left to play, but the Cowboys showed why they're a champion side to hit back almost straightaway.
Jake Granville sparked the initial break through Taumalolo, and from the ensuing play, the crafty dummy-half put former Panther Gavin Cooper over to set up yet another grandstand finish at Pepper Stadium.
The North Queensland No.9 continued to wreak havoc in the final stages, repeatedly getting his forwards on the front foot.
A desperate strip by Moylan on Taumalolo denied the Cowboys lock a certain try, but the resultant line dropout proved telling, with Coote knocking over the one-pointer to give his side the lead.
The Panthers had a chance with four minutes left, choosing to run it on the last tackle instead of going for the field goal. The play looked promising until Coote popped up to smother Mansour into touch to save the day yet again.
Soward had a 45-metre effort waved away with 90 seconds left, before O'Neill sent Kyle Fedlt over for the match-sealing try in the final minute.
Cowboys 23 (Javid Bowen, Justin O'Neill, Gavin Cooper, Kyle Feldt tries; Johnathan Thurston 3 goals; Lachlan Coote field goal) defeated Panthers 18 (Dallin Watene-Zelezniak 2, Trent Merrin tries; Jamie Soward 3 goals) at Pepper Stadium. Half-time: 12-10 Cowboys. Crowd: 13,725. On report: Matt Scott (pressure to the head/neck).