The home side started the brighter of the two sides with George Boyd looking lively, but the Clarets were unable to turn the dominance into goals in the early going.
The visitors responded through Joe Garner on 17 minutes, and the striker's volley was deflected just over the bar.
Gray came close to breaking the deadlock on the hour mark when he fired just wide from a Burnley corner, but real chances were at a premium in the North-West.
However, Will Keane made light of the lack of goal-mouth activity previously when he finished off a solo effort on 64 minutes to give Preston the lead.
Barton was fortunate to stay on the pitch when he was given a talking to from the official for a challenge on Tom Clarke when already on a booking.
Preston made the result secure inside the final five minutes when Garner's cut-back was converted by Daniel Johnson to give the Lilywhites a big victory over their local rivals.