Dean Bowditch had given Northampton a first half lead before both sides had a player sent off in the last 10 mins.
Town looked to have done enough but were punished at the death by Gary Alexander's late goal.
"I thought we deserved the win but we couldn't quite find that second goal. It was a tremendous effort and it has been a decent Christmas for us but it could have been even better had we held on in this game. I always felt we were in control of the game but we could have picked them off a little better if we had used the ball better," Gray said,
"On another day we would have won the game with the possession we had and the chances we created but we really wanted and needed that second goal."