Anaheim defenseman Hampus Lindholm was in the penalty box for the next two goals.
O'Reilly scored short side on a wrist shot from the right circle for a 2-1 lead at 15:55 with Lindholm off for holding, and Thomas scored short side from the right circle to make it 3-1 at 13:53 of the second period with Lindholm in the box for hooking.
"I thought we stayed with it," Blues coach Craig Berube said. "We had a good first period, I thought, and let them back in the game in the second period. They got that goal in the third, but we were positive on the bench, guys were good and stayed with it. We ended up fortunately getting the winner."