The game came to life in the last five minutes of the first half as Burnley took the lead through Charlie Austin's powerful header.
However, the lead lasted less than 30 seconds as Nicky Bailey fired a long-range shot into the bottom corner.
Middlesbrough began to take control of the match in the second half, and were only prevented from taking the lead by a fine Lee Grant save as Curtis Main's effort looked to be finding the bottom corner.
The hosts did go ahead with just over 10 minutes left, Adam Reach firing in a stunning strike to make it 2-1.
The lead was not as short-lived as Burnley's had been, but within six minutes the visitors found themselves level again as Junior Stanislas scored after McCann's header had been cleared off the line.
In scenes reminiscent of the first half, however, Middlesbrough hit back immediately, retaking the lead two minutes later courtesy of another fine strike, this time from Luke Williams.
Burnley pushed forward to try to force further late drama in the form of an equaliser, but Middlesbrough held out for the win.
Middlesbrough's next match comes against Crystal Palace on Saturday, while Burnley travel to Huddersfield on the same day.