Budget LOTS of time for the layover. If your incoming flight is delayed or you have any problems with immigration, you want plenty of time to sort it out.
Contact both airlines and explain to them what you are planning on doing. Get their advice and confirmation that this is okay, if there are any special requirements and any advice.