Ali Chaaban's penalty earned Staines a replay at Wheatsheaf Park 11 days ago but Steve Morison, Jack Smith, Alan Dunne and Danny Schofield struck to earn the Lions victory at the second attempt.
Kenny Jackett's side dominated early possession but it was Millwall keeper David Forde who was called into action first to push Chaaban's strike round the post.
But Millwall broke the deadlock after 41 minutes when Schofield's through-ball found Morison who made no mistake in firing past Louis Wells.
Millwall doubled their lead five minutes after the break when Morison turned provider and slipped in Smith behind the visitors defence who slotted home his first goal in a Millwall shirt.
Dunne then rose to head home from Schofield's corner after 79 minutes before Schofield got himself on the score sheet in injury time after a quick free-kick from Adam Bolder found him unmarked in the box.
Millwall will host Nigel Clough's Rams at the New Dean on January 2.