You can use optocoupler to drive for few mA, just ensure you have correct/wished level of collector current which is going to be base current to TIP1xx.
PC817 has 35Vceo breakdown. Depending on your actual Vcc on side of TIP1xx, a 70V part could be better matching, like HCPL-817.
Hope helps.
Addition: 8051 ports can support up to 20mA. It is not problem for optocoupler.