The presidential race between Kamala Harris and Donald Trump is essentially tied, according to a new WSJ poll that shows heightened support for her among nonwhite voters and dramatically increased enthusiasm about the campaign among Democrats.

The former president leads the current vice president 49% to 47% in a two-person matchup, but that is within the margin of error of plus or minus 3.1 percentage points. Trump held a six-point lead earlier this month over President Biden before he exited the race and backed Harris.

On a ballot test that included Robert F. Kennedy Jr. and other independent and third-party candidates, Harris receives 45% and Trump gets 44%. Kennedy is backed by just 4% and 5% remain undecided. Biden trailed in the multicandidate contest by six points in the last poll.

Harris has made strides in reassembling the coalition that put Biden in the White House in 2020, one that had been fraying under the stress of unease about his physical and mental sharpness. Black, Latino and young voters all showed greater support for her than they did for Biden in a Journal survey taken in the days after his disastrous debate performance on June 27.

A reshuffling of the demographic mix of Democratic support could alter the states where Harris might be competitive against Trump, a Republican running for a third time. Greater backing among nonwhite voters could help her in the more racially and ethnically diverse battleground states—Arizona, Nevada, Georgia and North Carolina—where Biden was struggling.

Harris is supported by 63% of nonwhite voters in the two-way race, up from the 51% Biden had in the last WSJ poll. While an improvement for Harris, her support is still below the 73% of nonwhite voters who, according to exit polls, backed Biden in 2020 when he narrowly won the White House.

The vice president is drawing a larger share of young voters, those under age 30, than Biden was earlier this month. But she still has less support among them than he did in his narrow 2020 victory.

Harris has also created a burst of enthusiasm within her party. Roughly four out of five voters in each party now say they are enthusiastic about their chosen candidate, reversing a lopsided deficit earlier this month among Democrats.

“Only 37% of Biden voters were enthusiastic about him in early July and now 81% of Harris voters are enthusiastic about her,” said Democratic pollster Mike Bocian, who conducted the survey with Republican pollster David Lee. “This is an astounding change.”

Harris also has the support of more Democrats than Biden had earlier this month, a key development because a candidate’s first job is to unify his or her party. Harris has support from 92% of voters who said they backed Biden in 2020, while the president had just been holding on to 84% of those voters in the earlier survey

Lee, the GOP pollster, said Harris and her party should be careful to not feel overly optimistic.

“While Democrats and many in the media will tout these tightened ballot numbers as a change in the race, let’s not forget that at this time in July 2020 The Wall Street Journal national polling had Biden leading Trump by 9 points and had Biden leading Trump in August by 11 points,” he said. “Donald Trump is in a far better position in this election when compared to a similar time in the 2020 election.”

Lee also pointed to the approval of Trump’s job performance as president in this survey, the highest recorded so far this election cycle in the poll. “A majority of voters—51%—approve of the job Trump did as president, while a majority of voters—50%—disapprove of the job Kamala Harris is doing as vice president.

A race that is essentially tied nationally means Trump would still likely have the Electoral College advantage, given the way the country’s population is dispersed. In 2016, Trump lost the popular vote to Hillary Clinton by nearly 3 million votes, but won more than 300 out of 538 Electoral College votes.

Ohio Sen. JD Vance , Trump’s newly selected vice presidential running mate, is viewed favorably by 42% and unfavorably by 44%.

Both the Harris and Trump campaigns are racing to more fully define the vice president to the public. The poll shows she is viewed favorably by 46% and unfavorably by 52%, which is her most positive showing in the poll this election cycle.

Harris faces significant headwinds. Her tenure as vice president is closely tied to a Biden administration record that includes a chaotic southern border, rising prices and protracted wars in the Middle East and Ukraine.

The poll shows Trump is viewed as more able than Harris to handle immigration, the economy, foreign relations and crime, while Harris is given the edge—51% to 33%—on dealing with abortion. Trump and Harris are rated nearly evenly on a question that tested who best “cares about people like you.”

The poll found 48% think Trump, 78, is too old to be president, while just 2% say that of the 59-year-old Harris. Close to half—46%—said Harris has the right temperament to be president. Just 38% said that of Trump.

The survey showed voters are still learning about many of the potential vice presidential running mates that Harris is believed to be considering. She will likely need to pick someone by Aug. 7 to meet the deadline for a virtual nomination procedure her party has established.

Of some potential candidates tested, Sen. Mark Kelly of Arizona, a former Navy fighter pilot and astronaut has the best ratings: 31% favorable and 19% unfavorable among voters overall.

The Wall Street Journal poll interviewed 1,000 registered voters July 23-25 and was conducted by Bocian of the firm GBAO and Lee of Fabrizio Lee. The margin of error is plus or minus 3.1 percentage points for the full sample.

Write to John McCormick at mccormick.john@wsj.com and Aaron Zitner at aaron.zitner@wsj.com