You will have to use the same Apple on both devices.
Set up text message forwarding
On your iPhone, iPad, or iPod touch, go to Settings > Messages > Send & Receive. On your Mac, open Messages, choose Messages > Preferences, then click iMessage. Make sure that you're signed in to iMessage with the same Apple ID on all your devices.
On your iPhone, go to Settings > Messages > Text Message Forwarding.*
Choose which devices can send and receive text messages from your iPhone. If you're not using two-factor authentication for your Apple ID, a verification code appears on each of your other devices: enter that code on your iPhone.
You will have to use the same Apple on both devices.
Set up text message forwarding
On your iPhone, iPad, or iPod touch, go to Settings > Messages > Send & Receive. On your Mac, open Messages, choose Messages > Preferences, then click iMessage. Make sure that you're signed in to iMessage with the same Apple ID on all your devices.
On your iPhone, go to Settings > Messages > Text Message Forwarding.*
Choose which devices can send and receive text messages from your iPhone. If you're not using two-factor authentication for your Apple ID, a verification code appears on each of your other devices: enter that code on your iPhone.