Substitute Donnelly had only been on the field four minutes when he met Grant's cross from the left and rose above Johnny Mullins to head home.
And Donnelly returned the favour nine minutes later, driving a fine pass across the face of goal for Grant to tap in from three yards. It was harsh on an Oxford side who played the better football and created the better chances during the first hour.
Tom Craddock saw a close-range header cleared off the line by Rhys Bennett and the visitors should have scored when Alfie Potter was left unmarked at the back post but side-footed across the face of Josh Lillis' goal and wide.
Grant wasted a gilt-edged chance to fire the hosts ahead when he was played through on goal by Ashley Grimes, the striker dragging his shot horribly wide with just Ryan Clarke to beat.
But the striker made amends when he teed up Donnelly's winner in the 78th minute. Grant wrapped up the win six minutes from time when he converted Donnelly's delivery from close range.