The Red Devils claimed Manchester bragging rights after beating the Citizens in a close encounter at Old Trafford.
Juan Mata’s goal was the difference between the two sides but it proved to be a controversial winner, as Ander Herrera looked to have fouled Fernando in the moments before Mata tucked his effort past Willy Caballero.
Jose Mourinho’s side progress to the quarter-finals and will be aiming to lift their first League Cup since 2010.
The Hammers booked their place in the last eight of competition thanks to a memorable win over their London rivals.
Cheikhou Kouyate opened the scoring for the hosts after beating John Terry in the air with a thunderous header.