Jon McLaughlin's howler cancelled out Aiden McGeady's opener in a disappointing draw at the Stadium of Light.
The Black Cats have been in control throughout the first-half, but were made to pay for not taking their chances.
In the end, Phil Parkinson's side can count themselves somewhat fortunate to still be in the hat for the next round as the Gills grew into the contest in the second half.
Here's how James Hunter rated the Sunderland players:
Doesn’t make many mistakes, but his howler from Lee’s free-kick proved costly
CONOR McLAUGHLIN 5
Almost scored an own-goal in the first half, and had a few shaky moments in the second
JORDAN WILLIS 6
Largely comfortable against Mandron
JOEL LYNCH 5
Kept Hanlan mostly under control, and the one time he let him get away it almost ended in a goal
LAURENS DE BOCK 6
Solid, if unspectacular
MAX POWER 5
OK in the first half, below-par in the second as Gillingham took over
GEORGE DOBSON 5
No shortage of industry, but did not affect the game enough from midfield
LUKE O’NIEN 6
Good energy down the right
CHRIS MAGUIRE 5
Sent a volley narrowly wide on the stroke of half-time, but that was as close as he came
AIDEN McGEADY 6
Scored the goal and generally looked Sunderland’s man most likely
WILL GRIGG 4
Worked hard, but that on its own is not enough
SUBS
MARC McNULTY 7
For Grigg 66mins. Did more in 25 minutes than Grigg had managed in an hour
DUNCAN WATMORE 6
For Maguire 77mins. Struggled to make an impact
NOT USED: Burge, McGeouch, Flanagan, Leadbitter, Kimpioka