Smith scored a right-footed volley to take the Gills level on points with fourth-bottom Coventry.
James McEveley had put Gillingham ahead in the first minute of the game, scoring a superb free-kick after a foul on Darius Henderson by Michael Duberry.
Clive Clarke hit the post for Stoke before Kenwyne Jones headed the visitors level from David Brammer's cross before Smith struck.
Stoke manager Tony Pulis:
"I think we need 74 points, that's 20 points more - it's a tall order but who knows?
"But this result was disappointing. It was a dreadful start to give a sloppy goal away after 40 seconds, which gave them confidence.
"We only really got going in the second half of the match."
Gillingham: Banks (Bossu 79), Nosworthy, Hope, Cox, McEveley, Southall, Smith, Douglas, Flynn, Sidibe, Henderson (Byfield 66).
Subs Not Used: Crofts, Hills, Jarvis.
Booked: Flynn, Smith.
Goals: McEveley 2, Smith 70.
Stoke: Simonsen, Thomas, Duberry, Taggart (Buxton 87), Hill, Harper, Brammer, Russell, Clarke (Greenacre 84), Noel-Williams (Ricketts 80), Jones.
Subs Not Used: de Goey, Henry.
Booked: Brammer, Taggart, Duberry.
Goals: Jones 54.
Ref: R Styles (Hampshire).