The result means the French team finished bottom of the group and failed to make the Europa League spot despite third-placed Olympiakos losing 2-0 to group runners-up Porto.
Argentine striker Aguero, who has struggled after knee surgery in the off-season, came off the bench in the 67th minute and took just 10 minutes to score, poking home after Marseille keeper Steve Mandanda failed to hold Nathan Ake's header from a corner.
"Happy to be back, happy for the W," Aguero tweeted after the match. "My knee is feeling better and I'm gradually getting back into condition. My gratitude goes to the physios, the medical and technical staff, my teammates and the fans for all your support."
Substitute Raheem Sterling added Manchester City's third with a tap-in in the final minute.
City finished on 16 points, a club record haul from the competition's group stage.