The Lions were forced to dig deep at the New Den after falling behind to Carl Cort's strike - the first goal they had conceded in four games. But their pressure eventually paid off as skipper Paul Robinson equalised fifteen minutes from time.
Millwall were unlucky not to take an early lead when Neil Harris' clever chip from the left-hand corner of the six-yard box came back off the inside of the post.
But, after 32 minutes, some static Millwall defending allowed Brentford right-back Karleigh Osborne to find Cort in acres of space, and his low shot squeezed under David Forde's outstretched hand and found the corner of the net.
Millwall dominated thereafter but found Bees goalkeeper Wojciech Szczesny in inspired form, the on-loan Arsenal stopper making three stunning saves to maintain his side's lead.
However, the Lions eventually gained their reward with 15 minutes remaining as Robinson powered home a header from Tony Craig's inswinging corner.