CASH-hungry Mel Gibson is selling off a massive chunk of his real es­tate portfolio, putting up three houses on 500 acres in Costa Rica for a whopping $29.75 million dollars.

Although Mel’s not on food stamps just yet, he’s telling pals that the combination of his dimin­ished earning power in Hollywood and the massive payouts he has to make to his ex-wife and baby mama are bleeding him dry.

“Mel is feeling a money pinch right now,” revealed a source.

The “Braveheart” star HASN’T been able to bounce back to his A-list status since he spewed racial and sexist insults during a drunk-driving arrest in 2006. He was later busted on a 2010 domestic battery charge involving former girlfriend Oksana Grigorieva.

“Studios aren’t laying out big bucks for him anymore,” the source explained. “He’s selling some of his Costa Rican property because he feels like he needs to scale back and cash out.”

The Academy Award winner, who once commanded $25 million per movie, hasn’t had a hit in more than a decade. His 2011 film, “The Beaver,” was a flop.

He’s set to appear in Sylvester Stallone’s upcoming “Expendables 3” and bulked up for the role – but he’s just another famous face in an all-star cast.

“For the most part, Mel is now viewed as a Hollywood pa­riah,” noted the source. “He re­alizes that his days of carry­ing a movie alone are long gone.”

Meanwhile, Mel’s ex-wife, Robyn, got $425 million in their divorce, and she’s also entitled to a huge chunk of his retirement. Her take includes half of his film residuals, large chunks of his pension benefits and half of the 401(k) benefits amassed through their production company.

And Oksana, the mother of Mel’s nearly-4-year-old daughter Lucia

got a $2 million home, a $750,000 settlement and tens of thousands of dollars in monthly support when they split after Mel threatened to kill her in an expletive-laced 2010 recorded rant.

“Mel has been complaining to friends that the payouts to his exes are draining his bank accounts,” the source added. “He rarely used that particular Costa Rican property and figured his best bet would be locking in a sale while the market is hot.”