Oldham grabbed their first win in four games and ended a run of three without a goal in emphatic fashion.
The home side's Mark Hughes smashed his first goal for the club, before Richie Wellens added a second.
City pulled a goal back when Scott Brown hammered home but Oldham's Chris Porter restored the two-goal advantage by heading his second of the season.
James Quinn scored on his City debut to set up a tense finish, but Andy Liddell and Scott Murray ensured the points.
Oldham: Day, Scott, Daniel Hall, Branston, Tierney, Liddell, Wellens (Forbes 84), Hughes, Eyres (Edwards 69), Warne, Porter.
Subs Not Used: Beckett, Chris Hall, Smith.
Goals: Hughes 4, Wellens 25, Porter 56, Liddell 87.
Bristol City: Phillips, Carey (Orr 53), Partridge, Sankofa, Woodman (Bridges 76), Murray, Wilkshire, Skuse, Brown, Stewart (Quinn 31), Cotterill.
Subs Not Used: Fortune, Bassu.
Goals: Brown 48, Quinn 79, Murray 90.
Ref: P Robinson (E Yorkshire).