A drug test can pick up fentanyl within 5 to 72 hours after your last dose. If they test your hair, the test could be positive for 90 days.