Magnus Ukuonghae gave the visitors the lead just after the break, rising unmarked to power home Luke Garbutt's corner.
Chelsea loanee George Saville put the home side ahead with 10 minute remaining, firing home a curling drive from the edge of the area.
Brentford might have gone in ahead at the break, but Trotta fired wide from three yards when it looked easier to score.
Adam Forshaw went close for Uwe Rosler's side, but his dipping free-kick was tipped wide by U's goalkeeper Sam Walker.
Saville also went close with a close-range header which just cleared the crossbar.
- Sports & Recreation
- Marcello Trotta
- Luke Garbutt
- Kadeem Harris