Clayton Donaldson fired home the winner three minutes from time after Posh had taken the lead with two second-half goals in as many minutes.
But United clawed their way back into it after the interval when Jack Payne equalised with a superb dipping 25-yard volley in the 58th minute.
But George Saville glanced McCormack's right-wing cross in-off the post with 10 minutes to go before Donaldson made it five defeats on the trot for Peterborough with the cruel late strike.
Brentford centre-back Tony Craig almost made it four in injury-time but was thwarted by a full-length save from Rob Olejnik.
- Sports & Recreation
- Clayton Donaldson
- Gabriel Zakuani
- Alan McCormack