Alfie Potter's late strike for Oxford condemned leaders Gillingham to their sixth home defeat in League Two.
Potter's pace allowed him to latch onto Tony Capaldi's long ball ahead of Gillingham's defence and he finished low into the left-hand corner.
The Gills' best chance came when Deon Burton's lay-off found Bradley Dack but Luke McCormick saved well.
At the final whistle some boos rang out, but Gillingham remain two points clear at the top of the table.
Sorry, we were unable to load match stats, please try again.