The Dragons had started well and were rewarded just four minutes later when Lloyd Lewis dodged through several Ospreys players to score the first try of the game. Connor Goode converted making the score 7-0 with five minutes played.
Goode and Luke Price then both sent penalty kicks wide before Price booted over three points to make the score 7-3.
The Ospreys then found themselves down to 14 men when prop Sam Martin was shown a yellow card but despite being a man down, the Ospreys kept up the offensive when scrum half Niall Popham chipped the ball downfield and gave chase. A few more taps saw him near the line but some sterling defence from the Dragons saw the rest of the first half remain scoreless.
The Dragons started the second half as they had the first and Goode capitalised on their dominance with a successful penalty kick.
The Ospreys were struggling to break through though the boot of Price was keeping them in the game. A penalty kept the deficit at a minimum and brought them back within four points.
And when Thomas dived over late on, the game was won. Price's conversion made it 13-10 at the final whistle.
Ospreys backs coach Kevin James, said: "We have to commend the Dragons, they were fantastic with their execution while we were a bit off it. But we showed great resilience and kept knocking at the door.
"We finished strong and got the win which is the most important thing. Obviously there are a few areas which were below the standard we set ourselves so we will be looking at them and working on them.
In the other game to take place, the Blues were 17-7 winners away to the Scarlets.