It is not important you had pregnancy 5 months back , important is if period is regular or not?
If period are regular then only it can be warranted the unprotected sex will lead to pregnancy or not
Example: if period is regular of 28 days then day 10 to 16 is fertile period if 30 days cycle then day 12 to 18 is fertile period. During this period can lead to pregnancy.
Next Steps
check if the days you quote in the range
Health Tips
use alternative contraceptive methods , closely observe for period miss and check with newer advance upt kit they are sensitive can diagnose within 7-20 days after pregnancy and ideally after 14 days so check it and use cafeteria approach for contraception next time.