Gladiators overcame a disjointed start to lead 10-6 going into the half time break but Cobras battled back in the second period to take the lead.
Chester levelled the scores 10 minutes from full time and looked the most likely to snatch the win but a penalty with 90 seconds left on the clock gave the home side the points.
Gladiators handed a first league start to Carl Gleave and welcomed back Dave Beddows and Jim Green but hooker Dan Rowett was unavailable so Paul Welch deputised.
Chester made a solid start but Gleave limped off with an ankle injury after five minutes meaning the visitors were left with only 16 fit bodies.
Cobras took the lead against the run of play when the Gladiators put in a deep kick but the ball was regathered quickly and the home side raced clear from the tap restart to go 6-0 in front.
Gladiators came back well and fullback Simon Quinn crossed out wide after a fine long pass from scrum half Chris Pape, although Quinn was unable to add the extras.
With half time approaching the visitors took charge and hit the front when loose forward Craig Jones - who was named man of the match - powered over from close range and Quinn converted to put Gladiators 10-6 up.
Rochdale had the better of the second half as Chester began to make errors and give away penalties and the hosts moved into a 12-10 lead with a close range try.
Cobras went further ahead on the hour mark with a try in the corner although the conversion was off target to leave Gladiators six points down.
Chester created a number of good openings but some rusty decision making meant the opportunities were not taken until 70 minutes when Pape found Lee Thomas who crossed out wide to tie the scores.
Gladiators pushed hard and had the home side under heavy pressure but Pape collected a knock on from an offside position and the referee awarded the home side a penalty in front of the posts with Cobras opting to take the two points on offer to steal the win.
Chester take a break from the league this weekend with a trip to Ince Rose Bridge in the North West Men's League Shield.