Hibernian have ended a ten-match winless streak by defeating St Mirren 2-0 at Easter Road.
Hibs had lost eight of their last ten Scottish Premier League outings before taking on the Saints, who prior to the meeting were sitting just above the Edinburgh club.
Hibs were close to a second when Riordan set up Ian Murray about 15 minutes later but his shot hit the post before Gallacher was able to save Riordan's strike as the home side kept coming.
They got a deserved second goal in the 90th minute when David Wotherspoon swept in from close range to help send his side up to 10th on the table.
Hibs boss Colin Calderwood was delighted that his side finally came up with a winning performance.
"It was a bit nervy on occasions, but the experience of our bad experiences certainly helped," he said.
"I'm delighted for the group because they're the ones who have really been under the spotlight and had question marks about them.
"They tried as hard as they've tried in the other games.
"There's a nice feeling in the dressing room, terrific togetherness by the players."