We report on optical and infrared observations of the anomalous X-ray pulsar (AXP) 1E 1048.1-5937, made during its ongoing X-ray flare which started in 2007 March. We detected the source in the optical I and near-infrared Ks bands in two ground-based observations and obtained deep flux upper limits from four observations, including one with the Spitzer Space Telescope at 4.5 and 8.0 microns. The detections indicate that the source was approximately 1.3--1.6 magnitudes brighter than in 2003--2006, when it was at the tail of a previous similar X-ray flare. Similar related flux variations have been seen in two other AXPs during their X-ray outbursts, suggesting common behavior for large X-ray flux variation events in AXPs. The Spitzer flux 1E 1048.1-5937 limits are sufficiently deep that we can exclude mid-infrared emission similar to that from the AXP 4U 0142+61, which has been interpreted as arising from a dust disk around the AXP. The optical/near-infrared emission from probably has a magnetospheric origin. The similarity in the flux spectra of 4U 0142+61 and 1E 1048.1-5937 challenges the dust disk model proposed for the latter.