Rebel's owners weren't home at the time, and a neighbor heard the dog whimpering and called for help, authorities said.
Riverside County Animal Services officers got on both sides of the wall and managed to extricate Rebel. The dog helped the officers by stiffening his hind legs as they pulled him out, Sgt. James Huffman told the newspaper.
"Somehow he got in through there, so we knew we could get him out," Huffman said, according to Fox News.
The predicament recalled that of a horse named Gracie, who got stuck in a tree in Pullman, W.Va., in 2008. The owner had to use a chainsaw to rescue her.