Jasper the Spaniel became stuck under rocks in the hole in the Low Wood Nature Reserve, Elam Wood Road, Riddlesden, Keighley.
A 'very labour intensive rescue' then ensued, West Yorkshire Fire service said.
One firefighter crawled under the rocks before pulling the dog out.
He was passed to how owner with no injuries.
The rescue took almost three and a half hours.
Crews attended from Cleckheaton Technical Resuce team along with a specialist Technical Rescue Officer, the service said.