Rory McIlroy pulled himself back into contention at the BMW Championship with a strong finish for a five-under par third round in St Louis.