The game was in additional time after the allotted injury time when Doug Loft scored an equaliser for the Gills.
First half chances were few and far between, with Sam Walker saving from Cody McDonald in the first minute being the only clear cut opening.
George Moncur put the U's ahead just after the hour mark, before Ehmer replied.
Chris Porter headed home four minutes from time, before Loft's late late leveller.
The game started with the home side on the attack, and Sam Walker had to make a smart save within thirty seconds to keep the game goalless.
Cody McDonald beat the offside trap to get one on one with the U’s keeper but his shot was kept out with a strong hand.
The U’s responded with a chance of their own, but Alex Gilbey’s effort from the edge of the box failed to really test Morris in the home goal.
Gills centre half Max Ehmer then shot well over as a corner was cleared to him, before the U’s started to get forward more.
A number of set pieces came to nothing, the best one seeing Chris Porter heading straight into the hands of Morris on eighteen minutes.
After that early scare, Sam Walker was relatively untroubled and his next involvement saw him comfortably save from a long range effort from Morris.
Just after the half hour, a scuffed shot from Matthew Briggs almost found its way to Porter but went well wide of the Gills’ goal.
On forty one minutes, the final chance fell to the hosts but Luke Norris’s shot went safely over the bar.
An uneventful forty five minutes ended goalless and it was certainly no indication of what was to come from the game.
Humes made a change at the break, bringing on Gavin Massey for Sembie-Ferris.
The second half started in the same way as the first, but it was the U’s that had the early chance.
Porter latched onto a defensive error but put his shot narrowly wide with only keeper Morris to beat.
There was a blow for the U’s on forty nine minutes, as David Fox injured an ankle and had to be replaced by Sammie Szmodics.
Two minutes later, George Moncur had a golden chance to put the U’s ahead, but he didn’t get the required contact on his volley and Morris made a regulation save.
A strong appeal for a penalty was waved away, as Briggs challenged for the ball in the U’s area, with Gills’ players and staff up in arms at the lack of a spot kick.
Just after the hour mark, Moncur made amends for his earlier effort, firmly sidefooting home from ten yards out.
Massey crossed to the far post, Porter headed back into the danger area and despite Szmodics being denied a header, Moncur finished emphatically to make it 1-0.
With sixteen minutes remaining, the hosts missed a chance to equalise as a wide free kick was whipped into the near post area.
Sub Marquis completely missed his header, having found himself in too much space in the U’s box.
But the U’s didn’t heed the warning and another wide set piece did bring a leveller for the Kent side.
Loft again provided the chance, with Ehmer flicking his header past Walker’s right hand and into the bottom corner.
On eighty six minutes, the U’s hopes of a second win in succession were alive again, as Porter scored to make it 2-1.
Massey carried the ball across the pitch from right to left, before rolling the ball into the path of marauding full back Matthew Briggs.
The loanee whipped in a fantastic ball and Porter’s bullet header gave Morris no chance.
The fourth official put up the electronic board, indicating five minutes of added time, and the U’s had to defend for much of it.
Walker made two great saves in the space of ten seconds, tipping onto the bar before diving left to push a header wide.
Briggs then received a second yellow card, and a subsequent red, for a challenge on McGlashan.
In added tine of added time, Murphy lost the ball in midfield and the cross from the left found Loft on the edge of the box.
His clever finish found the bottom corner and left a number of U’s players dejected on the deck.
There was no time for a third U’s goal and the final whistle went with the game level at 2-2.