Glenn Murray won and converted a 14th-minute penalty as Chris Hughton's team made an excellent start and, for the majority of the contest at the Amex Arena, Brighton appeared set to hold on to top spot.
Newcastle were short of their best but gradually worked their way into the contest and Diame levelled in fortuitous fashion nine minutes from time.
Substitute Perez then showed ice-cold composure in the penalty area to snatch an 89th-minute winner that puts Newcastle two points ahead of their opponents before another crunch promotion clash this weekend when they head to third-placed Huddersfield Town.
Yessssss! We are top of the league say we are ........Safe trip home toon army. Great support again. #brinew— Alan Shearer (@alanshearer) February 28, 2017
Newcastle struggled in the opening stages at Brighton, where Benitez neglected to start with a recognised striker. It was his countryman Perez who belatedly provided conclusive proof of the need for a specialist with his sixth and most important league goal of the season
Brighton's veteran frontman Murray was adjudged to have been wronged when grappling with Ciaran Clark and made no mistake after referee Robert Madley pointed to the spot.
It was no less than Albion deserved and Newcastle required heroics from Karl Darlow to avoid further damage.
The former Nottingham Forest goalkeeper kept out a stinging Murray volley three minutes before the break and denied Anthony Knockaert early in the second period.
Yoan Gouffran, nominally leading the Newcastle line, failed to punish David Stockdale when Darlow's opposite number hit a clearance straight to him and the ex-Bordeaux winger made way in the wake of Diame's equaliser.
There was more than a touch of fortune about the goal as Brighton failed to clear a corner and Christian Atsu's mishit shot struck the towering midfielder on his heel before looping in.
By contrast, the winner was wonderfully crafted – Matt Ritchie's crossfield ball catching out Bruno and allowing Atsu to pick out Perez for a first-time sidefooted finish.