Francis Meli scored two tries to help St Helens overcome Harlequins to reach the last eight of the Challenge Cup.
The hosts responded well to Keiron Cunningham's early try for Saints, Luke Gale and David Howell both going over to earn Quins a 10-6 interval lead.
But early second-half tries for Gardner and Meli, who later grabbed a second, were bolstered by one from Leon Pryce.
Young scrum-half Kyle Eastmond kicked five goals to ensure Saints' safe passage to the quarter-finals.
The first score came just before the quarter-hour mark for the visitors, Cunningham burrowing over from close range after Matt Gidley was held just short.
Saints were pinning the home side back in their own half with some tough tackling, but two costly errors in the space of seconds gifted Quins field position and they made it count, Howell twisting and turning to ground in the corner.
With seconds remaining in the half, Howell and Sharp combined to open up space and, although Luke Dorn was clawed down, the ball was shipped wide for Gale to stroll over.
But all that hard work was undone seconds after the restart, Dorn spilling a towering Pryce kick and Gardner scorched over in the corner.
Minutes later, there was a carbon copy, Eastmond's high kick causing havoc in the home defence and Meli gathered to walk over under the sticks.
By now Saints had their tails up and Quins were looking ragged, and the visitors cashed in with a further score as Meli cruised over after Pryce's looping pass left him in acres of space.
Eastmond then booted a penalty as St Helens pulled further clear.
Quins did offer themselves some hope thanks to a lightning break from Dorn, only for Ryan Esders to knock on with a try begging.
St Helens did afford Harlequins the respect of taking more points with the boot when they were offered, Eastmond slotting over another penalty with 10 minutes remaining to pad the lead to the 14-point mark.
And Pryce rounded things off, fending off tackles to cross with ease, Eastmond adding the extras.
St Helens coach Mick Potter told BBC Radio Merseyside:
"You can see how we came out in that second half, we come out very strong and really did all those little things right.
"We completed our sets and completed the last play and I was much happier in the last ten minutes of that second half.
"When you're in a knockout competition, if you're behind in the score board nothing else matters.
"I'm just happy we weren't behind for too long in that second half and we worked through it."
Bookmark with:
What are these?