MLB has a fairly robust revenue-sharing system, which has been in place since 2002. In the current version, all teams pay 31 percent of their local revenue into a shared fund, which is divided equally among all teams. In addition, more of the money coming into the league from national sources - network TV contracts and such - goes to lower-revenue clubs.
MLB also has a luxury tax system, which forces teams with high payrolls to pay a dollar-for-dollar penalty. But the luxury tax funds do not go to lower-revenue clubs; those receipts go into a central MLB fund - the MLB Industry Growth Fund - used for marketing programs.
The "shared fund" aspect of MLB's system might work as a model for the NBA. But the Association has had a luxury tax in place for years, and that hasn't done much to curb payrolls. The next CBA will almost certainly have some other system in place to cap salaries - if not a "hard" salary cap than a soft cap with fewer exceptions.