Donaldson latched onto a Jonathan Douglas through ball to coolly slot home for the equaliser.
And Trotta fired a low drive just inside the upright from the edge of the box to make it two shortly afterwards.
Brentford should have been level earlier after Alan Judge was bundled over in the box, but his powerful penalty was brilliantly saved by Murphy.
The visitors were an attacking threat in the first half, Wilson curling a delightful chip just over the angle and home goalkeeper David Button palming John Fleck's long-range drive past the post.
But once McCormack made it three it was all Brentford and Donaldson, Douglas and Stuart Dallas all went close.
- Clayton Donaldson
- Callum Wilson
- Marcello Trotta
- Alan McCormack