Stuart Beavon's fortuitous opener and Kevin Davies' penalty gave the hosts a two-goal advantage at half-time before James Tarkowski's late header for Latics ensured a frantic finish.
Grayson said: "It was a tough game and we knew that was going to be the case. We were made to work very hard and they created some good chances in the first half.
"They kept possession well and didn't allow us much of the ball and that meant we had to dig in and head balls in and around our 18-yard-box and battle hard.
"We know that we can play better than that. We need to do better without the ball than we did but we've got three points, we're still undefeated and we'll go into the top six with that result.
"It's good for us that both of our strikers are off the mark and hopefully there'll be a few more.
"That was probably our toughest game this season with the way that they play."