For the third consecutive season, Salah reached 30 goals in all competitions with his first-half goal.
The Egyptian star is the first player in Liverpool history to score in nine consecutive games at Anfield, his strike taking him to 100 career goals at the stadium.
He also moved level with Steven Gerrard’s tally of 186 goals at Liverpool, taking joint fifth place in the club’s all-time goalscoring list.
Jurgen Klopp’s fifth team climbed within a point of fourth-placed Manchester United after their sixth straight league win.
United’s defeat at Brighton in midweek gave Liverpool hope of qualifying for the Champions League via a top-four finish.
But United, who travel to West Ham on Sunday, are two games short and remain favorites to finish above their bitter rivals.
Salah’s memorable evening was partially overshadowed by Liverpool fans who booed the national anthem just hours after the coronation ceremony at Westminster Abbey.
Liverpool said on Friday they would play the anthem before kick-off despite “some supporters having strong opinions” on the matter.
As ‘God Save the King’ played, the boos and jeers were eventually drowned out by chants of ‘Liverpool’ from local fans.
Liverpool fans have booed the anthem on several occasions in recent years, including ahead of last season’s FA Cup final.
The UK government plans to leave the city for a ‘managed decline’ in the 1980s and the cover-up following the Hillsborough disaster in 1989, which killed 97 Liverpool supporters, has been cited as the reason for the protest anti-establishment.
Once the focus shifted from dissidents in the stands to action on the pitch, Liverpool showed why Klopp says training “is a joy again” after their recent revival.
Liverpool were beaten 3-1 at Brentford in January amid a dismal spell that summed up their largely disappointing season.
They are now a more cohesive unit and Salah opened the scoring with his historic goal in the 13th minute.
Fabinho’s high pass was headed in on goal by Virgil van Dijk and Salah was on hand to stab from close range.
Darwin Nunez missed a keeper when he scuffed from close range after Trent Alexander-Arnold’s high pass split the Brentford defence.
Brentford threatened to punish Nunez’s debauchery when Ivan Toney whistled a free-kick just wide from 30 yards out.
Bryan Mbeumo thought he had equalized after accelerating away from Van Dijk to pass Alisson Becker, but the goal was disallowed for a tight offside.
Liverpool were unbeaten in their last 122 games premier league games leading at halftime.
Cody Gakpo should have brought them closer to maintaining that streak when he somehow missed from close range after Diogo Jota’s pass gave him a glorious chance.
In a sluggish second half due to endless fouls from both teams, Gakpo narrowly exploded as Liverpool nervously clung to their lead.