Loan signing Brew, at Newport for one season from the Ospreys, went over twice in 15 minutes as the revved-up Dragons led 22-17 at half-time.
But two tries for Bryn Cunningham and scores from Andrew Maxwell and Declan Fitzpatrick ensured a second win over Welsh opposition in successive weeks.
The Dragons at least secured a bonus point for losing by just seven points but coach Paul Turner will know they could have secured four had they held on.
Three times they took the lead in a rousing first half display but each time they were hauled back by the champions before finally running out of puff.
A head injury to powerhouse No8 Nic Fitisemanu was a major loss. The Kiwi was carried off on a stretcher early in the second half following a clash of heads with Paddy Wallace.
Thankfully he was given the all clear later by doctors, but it was a blow for the Dragons having opened the scoring after just four minutes. Fitisemanu himself shrugged off Cunningham's tackle to score, after Mike Hercus and Nathan Brew had combined.
Fitisemanu also had a hand in the second try, scooping up a loose ball to give Aled Brew a clear run to the line after Maxwell had levelled for Ulster.
Brew then grabbed his second after Cunningham had again stolen the lead for Ulster, chipping over his opposite number before hacking the ball up field and sprinting past the last defender to touch down.
Ceri Sweeney exchanged penalties with David Humphreys who then found Cunningham completely unmarked out wide with his cross field kick to square the game 25-25 on 50 minutes.
Tensions rose as the game ticked on but it was Ulster who found the crucial break, replacement hooker Fitzpatrick crossing on 63 minutes after the Dragons defence fell apart. The Dragons battled back in the closing stages and dominated the scrums only for their scoring touch to elude them at the crucial moment.
Dragons: Tries - A Brew (2), N Fitisemanu. Cons -C Sweeney (2). Pens - C Sweeney (2).
Ulster: Tries - B Cunningham (2), A Maxwell, D Fitzpatrick. Cons - D Humphreys (3). Pens - D Humphreys (2).
Referee: D Changleng (Scotland)