Carmelo Anthony was voted to start in the All-Star Game for the seventh consecutive time and fifth time as a Knick it was announced Thursday night. But it was a very close race.

Anthony finished 360 votes ahead Chicago’s Pau Gasol for third place among Eastern Conference frontcourt players. The top three vote-getters at that position get to start in the Feb. 14 game in Toronto. Knicks rookie Kristaps Porzingis finished sixth.

Joining Anthony up front on the East team are Cleveland’s LeBron James and Indiana’s Paul George. The backcourt will be Miami’s Dwyane Wade and Kyle Lowry of the host Raptors.

Anthony tweeted “Humbled to be back. Thx for voting,” and that he’s “honored to play” with James, Wade, George and Lowry.

Lowry made a big jump to be named a starter. He trailed Cavs guard Kyrie Irving by 32,285 votes for second place among East guards in the previous balloting.

The Western Conference starters, as voted by the fans, will be Golden State’s Stephen Curry and Oklahoma City’s Russell Westbrook in the backcourt, with retiring Laker Kobe Bryant, Oklahoma City’s Kevin Durant and San Antonio’s Kawhi Leonard in the frontcourt.

Westbrook, the MVP of last year’s game at Madison Square Garden, and Leonard, who trailed Golden State’s Draymond Green by 12,321 votes for the third starting spot in the previous returns, were voted starters for the first time.

Bryant was the leading vote-getter and will play in his 18th and final All-Star Game in 20 NBA seasons. He received 1,891,614 votes, beating out Curry. The reigning league MVP garnered 1,604,325. James (1,089,206) was the only other player to surpass 1 million votes.

James and Wade were named to their 12th All-Star Games in 13 seasons. It’s Anthony’s ninth All-Star Game appearance in 13 years.

Anthony was involved in the closest race. He received 567,348 votes; Gasol had 566,988. Detroit’s Andre Drummond was third after the first two returns, and then only 6,000 votes behind Anthony in the previous update. But Drummond finished fifth, more than 51,000 votes behind Gasol.

Porzingis, the 7-3 forward who was sixth with 473,579, is a lock to compete in the Rising Stars Challenge during All-Star Weekend.

The starting selection was what Anthony wanted. His wife, LaLa, began a Twitter campaign after Anthony was behind Drummond in first returns. Then James, Wade, Anthony and Chris Paul cast Twitter votes for each other.

“Of course, I would love to be there,” Anthony said Wednesday night. “And I would love for my fans to vote me in.”

Paul wasn’t voted a starter, but he likely will be chosen as a reserve by the coaches. The reserves will be announced on TNT next Thursday before the Knicks play the Raptors in Toronto.