Shannon scrambled their way to a losing bonus point at Templeville Road, but they will be kicking themselves that they did not perform better against 14-man St. Mary’s.
St. Mary's prop Rob Sweeney was sent-off 11 minutes in the second half for retaliating after he was taken out off the ball.
Shannon's place-kicking scrum half Rob Guerin and Gavin Dunne, the St. Mary's full-back, swapped penalties in a lively first ten minutes.
A lengthy injury delay, with Shannon front rower Kevin Griffin in the wars, held up play before a stylish run and try from St. Mary's out-half Philip Brophy was converted by Dunne.
Shannon built pressure in the forwards, leading to a second Guerin penalty, although they were forced back on the defensive when their former centre Marcus O'Driscoll threatened regularly for St. Mary's.
Dunne replied to give the Dubliners a 13-6 advantage but Shannon, despite being error-strewn at times, snapped back to take a one-point lead at the break.
Dunne blotted his copybook when failing to deal with a kick through from the visitors and out-half Tadhg Bennett swept through for an opportunist try which went unconverted.
Guerin was back on target from the kicking tee late on though, his third successful penalty giving the Limerick side a narrow advantage.
Second-from-bottom Shannon were desperate for the win as they continue their fight against relegation, and another Guerin three-pointer kept them on course.
With Sweeney seeing red, Shannon's chances of winning greatly improved but they also had influential lock Fergal Walsh sin-binned for his part in the same incident.
St. Mary's, driven on by fit-again captain Richie Sweeney, soaked up a spell of pressure in their half before Dunne produced a smashing converted try to move the hosts back in front at 20-17.
A subsequent penalty attempt from Dunne shaved the post, but Hugh Hogan's side added a vital second try when Dylan Fawsitt, set up by fellow replacement Jerry Sexton, crashed over with Dunne converting.
Bennett stepped up to convert a penalty with eight minutes left and with St. Mary's going close to crossing the whitewash late on, Shannon will have been pleased to take a losing bonus point away from the capital.
If they stay where they are in the table over the remaining rounds, Shannon's fate will be decided by a promotion/relegation play-off against the team that finishes second in Division 1B.
Speaking after the game, Shannon coach James Hickey said: “It's very disappointing to lose, given the circumstances. Sometimes being a man down can be a massive motivator and that's the way it seemed to work for St. Mary's.
“At least we got a losing bonus point which could yet prove very important. We now face two 'cup finals' in our final two games against Young Munster and Lansdowne.”
Referee: Gary Conway (IRFU)