Sven Botman scored on his 100th appearance for the club to give United the lead after 24 minutes, but Vitaly Janelt levelled matters and Igor Thiago put the visitors ahead with a penalty just before half time.
Bruno Guimarães equalised from the spot but, in the 85th minute, Dango Ouattara rifled beyond Nick Pope to nudge Brentford back in front and give them the points.
It was a fifth win in their last seven games in all competitions for the Bees, who beat United 3-1 at the Gtech Community Stadium in November, but the Magpies haven't won in the league since the dramatic 4-3 victory over Leeds United in early January. This teatime kick-off was similarly incident-packed, but not in Newcastle's favour.
Harvey Barnes let fly inside three minutes but his effort was narrowly wide, then Sandro Tonali was off target from a free kick after Lewis Hall was fouled on the edge of the penalty area.
In the 15th minute, a Tonali corner was punched away by Caoimhin Kelleher as far as Jacob Murphy. His low drive was flicked goalwards by Barnes, but it went the wrong side of the post.
Then Mathias Jensen took advantage of a loose Murphy pass to stride towards the United box but Pope held his 20-yard strike.
But midway through the half, Botman opened the scoring. It was his third goal for the club and his first at St. James' Park as he celebrated a century of appearances in black and white.
Jensen had another opportunity for the visitors before superb play from Hall, with a bursting run and low cross, set up Yoane Wissa against his former club, but his shot was kneed off the line by Janelt.
And the German went on to head home from a brilliant Ouattara ball to equalise for his side.
Ouattara then cut the ball back for Jensen, whose shot was blocked by Murphy's arm from close range. The Newcastle man was unfortunate, and it look a lengthy VAR check to ascertain that it was indeed a handball, but Thiago sent Pope the wrong way for his 17th goal of the season.
Howe made a double change at half time, with Nick Woltemade coming on to partner Wissa and Anthony Elanga also introduced, with Murphy and Joe Willock making way.
That led to a strong start to the second period from United, with Barnes heading downwards - but wide - from a Kieran Trippier cross.
William Osula then replaced Wissa as the Magpies continued to search for a leveller. That almost arrived when Malick Thiaw carried the ball and unleashed a shot which was tipped away by Kelleher. Guimarães took the resulting corner, but it was headed into the side-netting by Botman.
But then came the equaliser. Osula broke swiftly and played in Elanga. Guimarães attacked his low cross and was hauled down by a clumsy Michael Kayode challenge.
And Guimarães stepped up to score from the spot and make it 2-2. The Brazilian had missed Newcastle United's last four matches with an ankle injury.
United's joy was short lived, though, as Ouattara netted five minutes from time.
In nine minutes of stoppage time, Hall took a quick free kick to Elanga and his centre was begging to be turned home, but Thiaw could only stab wide.
Ouattara fired over in the dying seconds but he'd already done enough to win the game for Brentford.
Newcastle United: Nick Pope, Kieran Trippier (Dan Burn 87), Lewis Hall, Sven Botman, Sandro Tonali (Jacob Ramsey 87), Yoane Wissa (William Osula 65), Harvey Barnes, Malick Thiaw, Jacob Murphy (Nick Woltemade 46), Joe Willock (Anthony Elanga 46), Bruno Guimarães (c)
Subs not used: Aaron Ramsdale, Alex Murphy, Leo Shahar, Sean Neave




