Burnley 4 Crystal Palace 2
The home side started brightly with early attempts by Chris McCann, Wade Elliott and striker Martin Paterson.
At the other end, on-loan striker Anthony Stokes had a shot from 20 yards tipped over the crossbar by goalkeeper Brian Jensen.
Palace took the lead on 20 minutes when Shefki Kuqi lobbed the ball over a stranded Jensen.
The visitors increased their lead eight minutes later when Burnley failed to clear a corner and midfielder Paul Ifill saw his shot deflected off Clarke Carlisle, past the stranded Jensen.
Burnley got back in the game six minutes later when a shot from Elliott struck the crossbar and Carlisle headed the rebound into the net.
The home team could have gone in at the interval all square only for a fine save from Julian Speroni, who denied Paterson.
Although Burnley pressed hard in the early stages of the second half it was the introduction of substitute Chris Eagles, on 68 minutes, which turned the tide in the home side's favour.
With 15 minutes remaining Eagles was denied by a fine save from Speroni. The substitute then headed a Graham Alexander free-kick just wide of the far post.
Burnley equalised nine minutes from time when they were awarded a controversial penalty by the assistant referee, which was converted by Alexander.
With two minutes remaining substitute Jay Rodriguez and Eagles combined for Steven Thompson to score at the far post.
Palace could have equalised but Claude Davis put the ball over the crossbar from inside the six-yard box.
That was to prove an expensive miss, as Thompson sent Rodriguez clear to steer the ball beyond the advancing Speroni.