United saw off League One Northampton on Wednesday, while City won 2-1 at Swansea to set up the second meeting of the two teams this season following City’s derby win on 10 September.
Elsewhere, West Ham will host London rivals Chelsea, while Tottenham travel to Liverpool.
Ties will be played on the week beginning 24 October.
City, who won the cup last season after beating Liverpool on penalties, are yet to lose under Pep Guardiola this season.
Jose Mourinho’s United ended a run of three successive defeats against Northampton, a sequence that had started with the 2-1 derby loss to City.
West Ham needed a dramatic injury time free-kick from Dimitri Payet to beat League Two Accrington Stanley and reach the fourth round, while Chelsea beat Leicester 4-2 in extra time on Tuesday.
There will be at least two Championship sides in the quarter-finals after Rafa Benitez’s Newcastle were drawn against Preston, while Norwich travel to Leeds.
Hull face Championship side Bristol City while Southampton and Sunderland were drawn in another all-Premier League encounter.
Arsenal face Reading, a team they beat 7-5 in the League Cup fourth round in 2012, having been 4-0 down at one stage.