Feeding 5V into the Mega: has to go into the USB connector, or has to go into the 5V pin on the power header.
Connecting to the barrel jack or to Vin will cause too much voltage drop with 5V feeding into the 5V regulator - you won't see 5V coming out, and the Mega needs 4.5V to 5.5V to run correctly.