Marcus Rashford scored twice for the Red Devils - including a stunning long-range free kick - as the visitors continued their upturn in form with a narrow victory in the capital.
Chelsea had plenty of the ball early on, but United continued to grow into the contest, and the visitors were awarded a penalty in the 24th minute when Marcos Alonso clumsily brought James to the ground.
Rashford missed a spot kick against Norwich City on Sunday, but the England international made no mistake on this occasion as he sent Willy Caballero in the opposite direction to make the breakthrough.
The Blues continued to concede possession in poor areas as the first period advanced, and United's 3-5-2 formation was causing Frank Lampard's side plenty of problems in the capital.
Jesse Lingard curled one into the arms of Caballero in the 37th minute as United looked for more goals, but the half-time whistle was blown with Rashford's penalty the difference between the two teams.
Chelsea had a golden chance to level the scores in the 50th minute when Alonso picked out Callum Hudson-Odoi with a fine cross, but the Englishman could not make proper contact after beating Williams to the ball.
There was much more intent from Chelsea in the early stages of the second half, and the home fans could sense that something was brewing as crosses continued to arrive into the United box.
Hudson-Odoi was next to come close just before the hour as the teenager struck over the crossbar at the end of another bright move from Lampard's side.
Chelsea finally levelled the scores just past the hour when Batshuayi held off the challenge of Maguire before finding the bottom corner with a brilliant strike from outside the box.
It was a poor goal to concede from United's point of view, but it was a fine effort from Batshuayi, who was given the nod in the final third at the expense of Olivier Giroud with Tammy Abraham on the bench.
Batshuayi again had the chance to run at the away side's defence in the 71st minute, but the Belgian lost his footing at the vital moment, which allowed Rojo the chance to clear his lines.
Romero made a decent save to keep out a low strike from Alonso as Chelsea looked to respond in the 82nd minute, but time was fast running out for the capital side.
Kovacic then missed the post from distance during a period where Chelsea were trying anything and everything in a bid to force a second, which would have brought a penalty shootout at Stamford Bridge.
Indeed, even Zouma struck one from distance which never threatened to trouble Romero.
United held on, though, to advance to the quarter-finals of the EFL Cup during a positive run of form which suggests that the club are now heading in the right direction after a disappointing start to the season.
Solskjaer's side will continue their Premier League season away to Bournemouth on Saturday afternoon, while Chelsea are next in league action at Watford in Saturday's late kickoff.
CHELSEA (4-3-3): Caballero; James, Zouma, Guehi, Alonso; Gilmour (Mount 70'), Jorginho, Kovacic; Hudson-Odoi, Batshuayi (Abraham 79'), Pulisic (Pedro 70')
MANCHESTER UNITED (3-5-2): Romero; Maguire, Rojo, Lindelof (Martial 66'); Wan-Bissaka, McTominay, Fred, Lingard (Pereira 67'), Williams; Rashford (Young 80'), James