Lloyd Owusu's second-half header against 10-man Oldham put Brentford into the FA Cup third round.
Oldham defender Gareth Owen was sent off in the 74th minute after being booked twice in the space of three minutes for fouls on Dudley Campbell.
Within five minutes of Owen's dismissal Brentford were ahead when Owusu rose above Marc Tierney to guide a header past Oldham goalkeeper Chris Day.
Brentford's reward for beating Oldham is a third round tie away at Stockport.
Brentford: Nelson, O'Connor, Sodje, Turner, Tillen, Brooker, Newman, Pratley (Peters 52), Tabb, Owusu, Campbell (Rankin 88).
Subs Not Used: Bankole, Gayle, Lewis.
Booked: Newman, O'Connor.
Goals: Owusu 78.
Oldham: Day, Forbes, Scott, Branston, Hughes, Wellens, Butcher (Owen 12), Edwards, Warne, Beckett (Tierney 77), Liddell.
Subs Not Used: Cronin, Eyres, Chris Hall.
Sent Off: Owen (74).
Booked: Scott, Branston, Beckett, Owen, Warne.
Ref: S Tanner (Somerset).