The Trump rally has some competition.

The gains in the Dow Jones industrial average since President Trump was elected, which had been by far the best in the past 50 years for any first-term president at the six-, 12- and 18-month marks, are now just the second-best.

Due to an almost 1 percent decline in the Dow this year — and a 45-point drop in the index in the last 4 minutes of trading Friday — the Trump rally in the 30-stock index stands at 34.1 percent.

That’s just a shade behind the 34.3 percent gain in the Dow from the day President George H.W. Bush was elected through June 22 of his second year in office.

This despite a record low unemployment rate as of May and a robust 4.7 percent gross annualized domestic product in the second quarter as of June 22, according to the Atlanta Federal Reserve Bank.

But stocks have been mixed recently, reacting to Trump’s tariff talk and a possible global trade war.

Since his inauguration, Trump and his team have taken pride in the fact that his Wall Street rally was the best.

In fact, after The Post reported in October that the Trump rally was on track to be the best in 85 years at the first anniversary of his election, Ivanka Trump, the president’s older daughter and senior adviser, shared the article on Twitter and borrowed the article’s first sentence.

“.@realDonaldTrump stock market rally is close to becoming the greatest in 85 years,” she tweeted.

Trump held a 14.6-to-11.7 percent advantage over Bush 41 at six months, a 28.5-to-23.3 percent lead at 12 months and a 32.9-to-28.5 percent lead at 18 months.

Trump does have an opening to take back the top spot.

While Bush 41 started out 1990 on a positive note — meeting with then-Russian President Mikhail Gorbachev and both committing to cut their nuclear and chemical stockpiles — the second part of the year went poorly.

The early 1990s recession took hold and Bush infamously reneged on his campaign promise of “no new taxes” — driving the Dow lower.

Trump doesn’t have to worry as much about having his rally fall to only third-best.

President Bill Clinton’s Dow rally after his first election win through June 22 is now third-best — sitting at just 14.5 percent.