City had the first opportunity of the match inside two minutes, but Gundogan's header from a Bernardo Silva corner was tipped over the crossbar by Basel goalkeeper Tomas Vaclik.
The home side had a chance of their own in the sixth minute when the lively Oberlin raced clear of the City defence, but the number 19 could not force the ball towards goal under pressure from Ederson.
Oberlin then went down in the City box under a challenge from Nicolas Otamendi in the 12th minute, although the referee was not interested as play continued.
City took the lead in the 14th minute when Gundogan headed a near-post Kevin De Bruyne corner into the back of the net.
Four minutes later, Pep Guardiola's side doubled their advantage on the night as Bernardo Silva found the top corner from inside the Basel box, although the home side's goalkeeper might well feel that he should have done better.
In-form Aguero then found the bottom corner from distance in the 23rd minute as Basel simply folded in the early stages of the last-16 first leg in Switzerland.
Sterling had a good chance to make it 4-0 in the latter stages of the first period, but Vaclik managed to claw the ball away from the Englishman at the vital moment, before De Bruyne just missed the crossbar with a rasping effort as three goals separated the two teams at the interval.
Basel had the first opportunity of the second period when Mohamed Elyounoussi struck one from distance, but Ederson was on hand to turn the ball around the post.
City were the more threatening in the final third, however, and the visitors scored their fourth in the 53rd minute when Gundogan collected a pass from Aguero before finding the top corner with a super effort.
Oberlin sent one wide of Ederson's post just before the hour as Basel looked to give their vocal supporters something to celebrate.
City introduced Leroy Sane and David Silva in the period that followed, with Sterling and De Bruyne departing as they were rested with the tie all but over.
Ederson had to keep out a close-range strike from Elyounoussi in the 68th minute as Basel continued to have their moments, with Oberlin also testing the Brazilian goalkeeper with a long-range free kick.
Gundogan then came close to completing his hat-trick 15 minutes from time when he met a cross from Aguero, but Vaclik made a super save.
The pace of the match dropped in the latter stages as City settled for four goals in Switzerland, which has seen them place one foot in the quarter-finals of the competition with a game to spare.
BASEL (5-4-1): Vaclik; Lang, Xhaka, Lacroix, Suchy, Riveros; Stocker (Ajeti 71'), Die, Frei, Elyounoussi (Bua 85'); Oberlin
MAN CITY (4-3-3): Ederson; Walker, Kompany, Otamendi, Delph; De Bruyne (D.Silva 63'), Fernandinho, Gundogan; B.Silva, Aguero (Danilo 85'), Sterling (Sane 57')