If I held stock in these companies yesterday, would I have profited by these gains?
No. For DZSI, your 5 shares at $1.10 would now be 1 share at $5.50, so you would have the same total amount. For SGY, they closed at $6.95, and opened at $32.80, so your five shares at $6.95 would now be one share at $32.80, so you would have actually lost money (not purely because of the split, but because the "new" shares are trading lower then the expected 1:5 split price).
A split in general does not affect market cap (how much your total shares are worth) but there may be residual effects that cause the market value to fluctuate after a split that affect the price.