The Robins stretched their unbeaten run to 10 games and are eight points clear at the top of League One, but keeper Frank Fielding earned their point with superb late saves.
City carved out the better first-half chances and both Aaron Wilbraham and Joe Bryan went close with far-post headers.
They made the breakthrough after 71 minutes when Wilbraham converted his 18th goal of the season, sliding home Luke Freeman’s cross to cap a flowing move down the left.
Oldham levelled within four minutes as Northern Irish midfielder Carl Winchester turned into space 25 yards out and drilled his shot into the bottom corner.
Fielding had to be at his best in the closing stages, clawing away Conor Wilkinson’s lob before bravely charging down a close-range effort from Jonathan Forte.
The visitors lost Mark Little to a dislocated shoulder, and Cotterill said: “It hasn’t been a good day.
“The goal we scored was fantastic, but it goes by the wayside because the goal we conceded was very poor.
“We could have done better defensively three or four times before Oldham scored and, because of that, we didn’t deserve anything more from the game.
“Oldham weren’t very good today and neither were we. It was a good game of football when we played them earlier in the season, but that wasn’t the case today.
“The pitch was rubbish and that’s probably why the game was so average. It didn’t help, but it’s bobbly for both teams.
“Maybe we could have done better with a period of dominance in the second half, but we didn’t take our chances and that’s what cost us in the end.”
Oldham manager Dean Holden was frustrated his team could not force victory and move closer to the play-off places.
He said: “I feel for the players because every one of them stood up to the test, but you don’t always get what you deserve.
“We had some good chances and I think we deserved to win, but their keeper made two or three outstanding saves.
“It’s a very pleasing performance because Bristol City are a top team who will go up this season and will probably do well in the Championship.
“We’ve had a lot of adversity at times this season, so it showed character to come back and take a point against such a good side.
“This was a game where we felt we should go for it – Bristol City play three at the back, so we threw three men up front and really had a go.
“It’s disappointing not to win, but we can take a lot of confidence from our performance.”