The second-in-commands in companies’ finance departments—treasurers, heads of accounting, controllers and vice presidents of finance—are taking home larger paychecks, benefiting from increased competition for talent and their businesses’ improved financial performance.

At many companies, deputy-level finance executives in recent years have played a more prominent role in helping their chief financial officers lead their departments, recruiters and executives said. Some CFOs have taken on more strategic and operational duties in recent years—for instance, information technology and supply-chain matters—and want a top-tier accounting executive at their side. Meanwhile, corporate treasurers early on during the pandemic stepped into the spotlight by helping their companies stockpile cash and develop liquidity forecasts.

These executives are benefiting from some of the same trends that are pushing up compensation for finance chiefs and other senior leaders, including a tight labor market, the more frequent use of one-time cash or stock awards and double-digit increases in annual cash bonus payouts after many companies last year exceeded their financial targets.

Corporate treasurers, one of the highest paid finance roles apart from that of the CFO, saw a 23% increase in their median cash bonuses during the most recent fiscal year compared with a year earlier, totaling $134,500, according to Mercer, a benefits advisory firm. Total median compensation for the role—including salary, cash bonuses and stock awards—rose 6%, to $441,230, over the same period, Mercer said. The company’s data is based on a survey of 300 publicly traded companies across industries with median annual revenue of $3.48 billion. The figures include amounts earned for the most recent 12-month period that ended before April 1.

By comparison, CFOs received a 50% increase in their median bonus pay, to $684,200, as well as a 58% bump in total compensation to just over $2 million, according to Mercer.

Some companies, aware that their No. 2 finance executives are being contacted by recruiters, are giving out one-time bonuses to retain talented executives, especially those who are viewed as potential successors to the CFO, and giving them additional responsibilities to help them move up the corporate ladder, according to corporate recruiters. “They put together a retention grant that’s going to make it very expensive to leave,” said Aaron Rouza, partner and co-head of the finance practice at recruiting firm True Search.

Companies are also offering benefits to new hires such as guaranteed cash bonuses, which aren’t at risk if the business misses its performance targets, or options for flexible and remote work, recruiters said.

Chief accounting officers, in particular, have been in strong demand across industries over the past year as many finance chiefs take on responsibility for operational issues, said Cathy Logue, head of the CFO and financial executives practice at recruiting firm Stanton Chase. Some companies are offering salaries that are as much as 20% higher than what the executive earned before, she said. “Demand drives price,” she said.

Sonder Holdings Inc., a San Francisco-based company that manages and operates short-term rental properties, in August hired its first chief accounting officer after going public in January. Chris Berry held the same title for five years at Alaska Air Group Inc., a Seattle-based airline, in addition to serving as vice president and controller.

Sanjay Banker, CFO of Sonder Holdings

Photo: Sonder Holdings Inc.

Sanjay Banker, finance chief at Sonder, said the recruitment process was challenging because the company had specific qualifications in mind, including public company experience, knowledge of the travel and hospitality industry, a good match for the company culture, and a willingness to join a young company and help it grow. Still, it was relatively easy for Sonder, which was founded in 2014, to get candidates to pick up the phone, Mr. Banker said.

“When we were out looking, we got a lot of people to take our call,” Mr. Banker said, adding that finance executives were open to discussing new job options. In his new role, Mr. Berry earns a base salary of $400,000, and received a one-time equity award of 400,000 restricted stock units, according to a regulatory filing.

Wendy Zheng, who last week joined privacy and data-management software company OneTrust LLC as chief accounting officer, said she receives at least one message a day—via email, phone or LinkedIn—from recruiters asking to discuss new job opportunities. Ms. Zheng was previously corporate controller for nearly three years at identity-management software company Okta Inc. OneTrust, which is privately held, has raised $920 million from investors including SoftBank Group Corp. and investment manager Franklin Templeton.

Wendy Zheng, chief accounting officer of OneTrust LLC

Photo: OneTrust LLC

Ms. Zheng said she took the phone call from OneTrust’s recruiter after a former boss recommended her for the role. She accepted the offer because she wanted to build a new team, design business processes for the finance function and work with the company’s leadership team, she said. “I’ve done my outreach to start hiring my next layer,” she said. Ms. Zheng declined to share details about her compensation apart from saying that she receives a higher share of equity at OneTrust than in her previous role.

Netflix Inc. in June hired Ken Barker as chief accounting officer, succeeding JC Berger, who served as global controller, according to a spokeswoman. Mr. Barker, who was previously senior vice president of finance at videogame maker Electronic Arts Inc., was hired with a salary of $2.4 million, as well as an annual stock-option allowance of $600,000, according to a regulatory filing. In his new role, Mr. Barker serves as Netflix’s principal accounting officer, a role previously held by CFO

Spencer Neumann, who continues to serve as the company’s top finance officer, the filing said. Mr. Barker reports to Mr. Neumann.

Vice presidents of accounting received a 12% increase in their median pay in the most recent fiscal year, earning $388,400, according to Mercer. Controllers and vice presidents of finance also saw their total median compensation increase by 14% and 15%, to $358,250 and $417,550, respectively, Mercer said. The company doesn’t track pay for chief accounting officers.

Treasurers have been rewarded for their work to shore up cash reserves over the past two years, according to survey data from the Association for Financial Professionals, a professional organization. Treasurers received a 31% increase in their annual bonus during the 2021 calendar year compared with 2020, earning an average of $92,055, according to the AFP.

By comparison, finance chiefs within AFP’s survey received a 13% increase in their cash bonus pay, taking home $96,756. Vice presidents of finance saw their bonuses decline by 1%, to $56,663, while controllers received a 2% increase, to $27,782.

The AFP’s survey included respondents from 1,910 treasury and finance professionals across industries and included nonprofit organizations. Thirty-four percent of respondents came from firms with less than $100 million in annual revenue, 28% from firms with revenue ranging from $100 million to $1 billion, while the remainder generated more.

Mike Richards, chief executive and founder at Treasury Recruitment Co., which focuses on recruiting treasury roles globally, said he expects compensation to keep rising in the year ahead, despite the chance of an economic downturn. That is because senior executives in the role who delayed retirement during the pandemic are stepping down and younger executives are finding it relatively easy to switch jobs, he said.

“The U.S. treasury recruitment market is on fire right now,” Mr. Richards said.

Write to Kristin Broughton at Kristin.Broughton@wsj.com