The game of golf is recovering from years of triple-bogies.

As budget-conscious middle-class Americans massively quit the game, the rich are propping up the struggling golf industry — and golf-crazed titans of corporate America and Wall Street are among the biggest hitters.

The statistics show the hazards: 400,000 people left the sport in the US last year, according to the National Golf Foundation. Some 160 golf courses nationwide closed in 2013 — the eighth straight year of net closings. All told, US golfers played 462 million rounds of golf in 2013 — the fewest since 1995.

But there’s no golf recession in the metro area, as the financial topdogs gobble up tee times and memberships.

While the C-suite banking execs always strut their handicaps, from JPMorgan’s Vice Chairman Jimmie Lee’s healthy 5 to Goldman Sachs CEO Lloyd Blankfein’s reported 24, it’s the minions under them who are flocking back to the clubs.

“They’re making money again, they’ve got expense accounts, they’re making deals — and they’re doing that playing golf at the country club,” said Tom Stine, co-founder of Golf Datatech, an independent industry research firm.

Analysts blame the decline in golf on the lingering effects of the Great Recession, changing lifestyles and reversal of the overly ambitious growth during the heyday of golf.

The sharp contraction, say analysts, is not reflected among the most affluent Americans.

“Golf is seeing a growth spurt in the business community,” said Jed Hughes, head of global executive placement in Korn Ferry’s sports practice.

Hughes, who has placed CEOs, GMs, athletic directors and head coaches, says some of the best deals are done today on the links, uninterrupted by social media and cell phones. “I’ve seen CEOs hired, companies merge, big union deals done and board directors selected — on the golf course,” he said.

Hughes, an avid golfer, lives in western Pennsylvania, not far from the posh 18-hole Arnold Palmer-redesigned Laurel Valley Golf Club frequented by the corporate jet-set.

A round of golf, with overnight accommodations and extras, can run about $1,000 per person, Hughes figures.

“There are probably 60 to 70 corporate jets lined up at the airport, 10 minutes away — with limos picking up the passengers for a game at the club,” said Hughes, on a perfect sunny day last week. “They’re here from New York and all over.”

In the New York metro area, golf had a good 12 months despite the toughest winter in years. Rounds of golf played were up in May compared with a year ago: 3 percent in New York City, 5.6 percent in New Jersey and 4.1 percent in Connecticut, according to Golf Datatech.

Rising memberships at some of the swankiest country clubs reflect bonuses and comp, according to Frank Gregory, a senior executive at mutual fund manager BPV.

With a huge concentration of affluent golfers, New York has weathered the golf storm better than other places. After the Great Recession, many top-notch local private clubs “discounted” pricing and improved service. It lured back some well-heeled golfers. “You’re seeing a lot of the very high-end courses with top-shelf amenities today,” Gregory said.

The initiation fees alone at these exclusive courses are unaffordable to all but the super-rich and execs on corporate accounts.

By one recent assessment, they range from around $150,000 at the Bayonne Golf Club to a rumored $1 million at the tony Sebonack Golf Club in Southhampton.

Another, Trump National Golf Course in Bedminster, NJ, is said to charge initiation fees of $350,000. “People are joining these country clubs again — the economy is better,” said Stine.

Not surprisingly, many institutional investors see green.

Last September, the No. 1 operator of private golf clubs worldwide, ClubCorp Holdings of Dallas, went public, trading at $14 a share. It’s up 26 percent from its IPO price.