Caspofungin injection is used in adults and children 3 months of age and older to treat yeast infections in the blood, stomach, lungs, and esophagus (tube that connects the throat to the stomach.) and certain fungal infections that could not be treated successfully with other medications.