The wonder strike on the stroke of half-time, coupled with Matej Vydra's late effort, gave Sean Dyche a victory at his old club and means this is the joint-furthest the Clarets have gone in the competition since the 49-year-old took over in 2012.
Progress came at a cost with forward Jay Rodriguez injured early on, but it will be Burnley who host the Thursday night winner of Manchester City or Bournemouth at Turf Moor next week.
Burnley were without a number of players, including Johann Berg Gudmundsson who picked up a knee issue in the last round win over Sheffield United.
Unfortunately for the Premier League side, their Carabao Cup injury curse struck again in the 12th minute when Rodriguez hurt his left ankle after he headed over.
He was withdrawn after treatment on a rain-soaked pitch at the Den to make the forward a doubt to face old club Southampton at the weekend.
Matt Lowton could have provided boss Dyche with a lift after 34 minutes, but he dragged an effort well wide from the edge of the area after substitute Chris Wood had been a nuisance.
Dwight McNeil went closer following a promising run and yet fired straight at Millwall goalkeeper Bartosz Bialkowski before the deadlock was finally broken on the stroke of half-time in the capital.
The hosts managed to defend another corner but Brownhill showed his class from 30 yards with a thunderous strike into the top corner for his first Clarets goal since a £9million move from Bristol City in January.
Millwall manager Gary Rowett made a change during the interval with Tottenham loanee Troy Parrott replaced by Mason Bennett only 45 minutes into his full debut following his recovery from a quad injury.
Referee Andy Davies showed yellow cards to Burnley pair Brownhill and debutant Bobby Thomas at the start of the second half as tempers started to get heated..
Hayden Muller was the latest youngster to enter the fray with 21 minutes remaining when the Millwall boss introduced the 18-year-old for Mahlon Romeo.
Dyche responded by taking off Brownhill, who had been the stand-out player on the night, and his side should have sealed their place in the fourth round with 15 minutes left.
McNeil embarked on a mazy run down the left and picked out Wood at the back post, but he headed wide and minutes later Vydra and Thomas were denied by Bialkowski in quick succession.
The Lions continued to ask questions of the visitors, but Burnley's young centre-back partnership of Jimmy Dunne and Thomas stood firm to ensure goalkeeper Peacock-Farrell claimed a clean sheet on his first start for the club since joining from Leeds last summer.
And Vydra netted deep into stoppage time to wrap up the victory.