It seemed that the encounter at the Central Coast Stadium was going to end in a goalless draw, but Roar substitute Dimitri Petratos struck five minutes from time to hand the visitors all three points.
Roar mustered 11 shots on goal during a first half in which they dominated, yet they were unable to find a way beyond Paul Izzo in the home side's goal.
They continued to look the most likely to break the deadlock after the restart and their pressure was eventually rewarded in the 85th minute.
Having been picked out on the edge of the penalty area by Jean Carlos Solorzano, Petratos created himself enough space and then produced a shot that found the far corner of Izzo's net. It was the former Australia international's second goal of the campaign.
The victory has moved Roar up to second place in the A-League standings, while the Mariners remain bottom.