Neumann and Dimon chat from time to time. A JPMorgan fund bought a stake in WeWork five years ago and the bank has since propelled the startup’s growth, providing more financing than any other lender. When Neumann wanted to use his stock to borrow money, the bank made it happen. When he added to his collection of luxury homes, JPMorgan was the lender, issuing almost $40 million in mortgages.

Now all of that attention is poised to pay off.

As WeWork prepares for an initial public offering next month, Dimon’s bank is helping Neumann’s company line up its most ambitious fundraising yet: a $6 billion package of debt financing that depends upon the IPO raising at least $3 billion. Behind the scenes, JPMorgan has indicated it will contribute $800 million of the loans, more than any other lender. The bank also is expected to takethe coveted first -- or lead left -- position in WeWork’s syndicate for the IPO, giving the firm bragging rights and a hefty chunk of the fees.

“It’s a well-known company with explosive growth and big-name backers,” EquityZen analyst Adam Augusiak-Boro said in an interview. And “there certainly is this allure of large fees.”

The unorthodox pairing of debt and equity injections could pose unusual challenges for JPMorgan’s bankers, along with reputational damage if the IPO flops. WeWork achieved a $47 billion valuation in its latest private fundraising, a level that now looks like a stretch for its market debut, Augusiak-Boro said. But if all goes well, JPMorgan stands to profit handsomely over the long term.

A fund within JPMorgan Asset Management reported a stake in WeWork that has multiplied in value over the past half decade, to surpass $600 million, a regulatory filing from last month shows. A successful listing could help the firm monetize that holding.

WeWork also will need to keep tapping markets to carry out its expansion into more types of properties and businesses in coming years, creating yet more work for investment bankers.

SoftBank BusinessAnd then there is WeWork’s biggest backer, SoftBank Group Corp.’s $100 billion Vision Fund. Bankers have long seen WeWork’s IPO as an opportunity to cozy up with the deep-pocketed investment vehicle, potentially gaining the opportunity to cater to its stable of startups for decades.

JPMorgan’s ties to WeWork CEO Neumann and his company are varied. The bank led an offering earlier this year of commercial mortgages including one for a building where WeWork is completing an 11-floor build-out of a boutique office within walking distance of two of Neumann’s Manhattan apartments. JPMorgan also issued him mortgages so he could buy one of those homes and one in Westchester County, according to public filings. And a savings plan for JPMorgan’s own employees has put roughly $800,000 into WeWork’s junk-rated debt.

Landing the stock sale would be a coup for JPMorgan. The bank has been the underdog to Goldman Sachs Group Inc. and Morgan Stanley in handling Silicon Valley IPOs. Handling WeWork’s offering could show that JPMorgan is gaining momentum after leading Lyft Inc.’s offering earlier this year.

Still, it’s hardly the only firm that engaged with Neumann in ways that could help curry favor.

Goldman TiesGoldman’s efforts were publicly visible in December, when the firm’s former CEO, Lloyd Blankfein, palled around with the entrepreneur at a charity event. Taking the podium, Neumann told an audience packed with Wall Street leaders about getting to know Blankfein, marveling at his ability to hold court on any topic.

“We have been having so much fun,” Neumann said, gesturing to the banker. One time, over dinner, “Lloyd said, ‘Ask me anything,’ and I said, ‘Spanish Inquisition -- go!’ And you said so many names and so many things I didn’t even know existed. It was amazing.”

Goldman’s lead bankers on the deal are Dan Dees, Kim Posnett and David Ludwig, according to people with knowledge of the matter. Like JPMorgan, Goldman acquired a stake during WeWork’s venture-funding rounds, and filings show that the bank’s real estate trusts have exposure to WeWork mortgages. The lender is expected to help lead the IPO with JPMorgan, according to people with knowledge of the discussions.

Morgan Stanley’s star technology banker, Michael Grimes, also has sought to build a relationship with Neumann, according to a person with knowledge of the situation. Property records show Morgan Stanley provided him with almost $10 million of mortgages for homes in Manhattan and the Hamptons.

Wealth AdviserUBS Group AG’s strongest relationship with Neumann is through a private-wealth adviser, Adam Epstein, people with knowledge of the matter said. The Swiss bank, like JPMorgan, helped Neumann capitalize on his stake in WeWork before an IPO by taking out a loan against his interest.

UBS also agreed last year to have WeWork overhaul a 30-year-old wealth-management office overlooking the Hudson River in the office-sharing company’s largest design deal at the time. UBS is likely to land spots in both the debt and equity fundraisings, and will be one of the biggest lenders, according to people with knowledge of the situation.

Bank of America Corp., meanwhile, agreed to have WeWork revamp three floors of its tower near midtown Manhattan’s Bryant Park. And when WeWork raised more than $700 million in its debut junk-bond offering last year, Bank of America was among the biggest underwriters. Chief Operating Officer Tom Montag and Karen Fang, an executive in the bank’s bond-trading division, tended to the relationship.

Representatives for WeWork and the banks declined to comment.

There were more than a dozen banks on last year’s debt offering, and the list of IPO banks is expected to be even longer. Pressure on the syndicate will be high after this year’s tumultuous listings for Lyft and Uber Technologies Inc.

Still, said EquityZen’s Augusiak-Boro, “if WeWork is a complete nightmare, I think Morgan Stanley, Goldman Sachs and JPMorgan are still going to be here in six months chasing the big IPOs and getting hired for them anyway.”