Deon Smith, George Gasson and James Benjamin all crossed the whitewash for Dragons, but a try double from home wing Aaron Sexton and the reliable boot of Johnny McPhillips sent Ulster clear.
After a tight opening, McPhillips opened the scoring with a penalty after 19 minutes before Dragons hit back with Smith touching down out wide.
McPhillips put the hosts back ahead with his second penalty of the game before wing Gasson touched down on the opposite flank, with Jacob Botica added the difficult extras from the touchline.
However, it was Ulster who led 13-12 at the break with Sexton going over three minutes before the break.
Sexton added another try 13 minutes into the second half before McPhillips sent his team clear with two penalties.
Dragons, though, battled until the end and were rewarded with a third score when a clever cross field kick found Benjamin to dot down in the final minute.
Timeline:
19m McPhillips p 3-0
22m Smith t 3-5
25m McPhillips p 6-5
30m Gasson t Botica c 6-12
34m Sexton t McPhillips c 13-12
53m Sexton t 18-12
62m McPhillips p 21-12
77m McPhillips p 24-12
79m Benjamin t Botica c 24-19
80m McPhillips p 27-19
Dragons A (v Ulster A): Carwyn Penny, George Gasson, Tom Hoppe, James Benjamin, Deon Smith, Jacob Botica, Rhodri Davies; Josh Reynolds, Rhys Lawrence, Chris Coleman, Matthew Screech, Max Williams, Ben Fry, Lennon Greggains (c), Taine Basham
Replacements: Zac Hewlett, Scott Evans, Luke Yendle, Joe Davies, Rob Brookson, Dafydd Buckland, Calvin Wellington, Will Kelly