Oil companies are pumping more crude off the U.S. coast in the Gulf of Mexico, a surprising trend that shows the resilience of the nation’s energy industry.

Despite the worst price downturn in a generation, so much oil is starting to pour forth from offshore fields near Louisiana and Texas that it is partially offsetting declining output from shale regions on shore and propping up total American oil output.

The...