Following Burnley's defeat to Tottenham, Frank Lampard's men knew a win would officially get them out of trouble.
And they got off to the perfect start as a free-kick from the right fell to Dominic Calvert-Lewin, who forced the ball into the net.
However, the Toffees were reduced to ten men when Jarrad Branthwaite was sent off for bringing Ivan Toney to the ground.
Brentford soon hit back as Yoane Wissa's curling shot deflected in off Seamus Coleman, however, Everton restored their lead through Richarlison's penalty just before half time.
But in the space of three second-half minutes, Everton's lead turned into a deficit with Wissa and Rico Henry netting for the Bees. The match also saw Salomon Rondon get sent off just four minutes after coming on.
The Everton faithful once again gave their players a brilliant reception as their players arrived pre-match and the prospect of sealing survival understandably had Goodison Park bouncing.
Lampard's side could've had the lead on three minutes but Richarlison headed wide on the rebound after David Raya kept out Anthony Gordon's goalbound shot.
However, they had the lead in the tenth minute when the ball bobbled in via Calvert-Lewin's midriff after Richarlison got a faint touch on Gordon's free-kick from the right.
The course of the match turned shortly after as Branthwaite was given his marching orders for his clumsy challenge on Bees striker Toney.
There's no doubt Toney was denied a clear goalscoring opportunity but the red card proved controversial as just seconds earlier referee Michael Oliver decided not to give Everton a penalty even though Kristoffer Ajer was seen grabbing a large chunk of Richarlison's shirt inside the Brentford box.
Thomas Frank's men levelled the scores on 37 minutes as Wissa retrieved the ball on the left before his ball across struck Coleman's back and flew beyond the despairing Jordan Pickford in the Toffees goal.
Everton responded well and got their penalty in stoppage time at the end of the first half after Mads Bech Sorensen hauled Richarlison to the ground. Richarlison duly stepped up and slotted the ball comfortably past Raya.
Brentford were buoyed by the man advantage though and equalised again as Christian Eriksen's corner found Wissa, who's near-post header looped over Pickford and the Everton defenders before dropping into the net on 62 minutes.
And just two minutes later Brentford went ahead as Henry's bullet header gave Pickford no chance.
Everton's search for an equaliser was pretty desperate and the 88th minute saw them get reduced to nine men as Rondon, who was thrown on by Lampard just four minutes earlier, was dismissed for a poorly-timed and high challenge on Henry.
The result leaves Everton at risk of being relegated to the Championship but they can confirm their survival with a win at home to Crystal Palace on Thursday night. Meanwhile, Brentford go up to 11th in the table.