The only way to do this is to do the cash out refinance first. This allows you to season the down payment for the purchase and allows the lender to accurately calculate your debt to income ratio because the new mortgage payment should be reporting by the time you apply for the purchase.
You should also know that you will need to qualify for both mortgages without including the anticipated rental income when you apply for the investment property loan.
The only way to do this is to do the cash out refinance first. This allows you to season the down payment for the purchase and allows the lender to accurately calculate your debt to income ratio because the new mortgage payment should be reporting by the time you apply for the purchase.
You should also know that you will need to qualify for both mortgages without including the anticipated rental income when you apply for the investment property loan.