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 close race.

Anthony finished 360 votes ahead of 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 was 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 host Toronto.

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, Oklahoma City’s Russell Westbrook and Kevin Durant, retiring Laker Kobe Bryant and San Antonio’s Kawhi Leonard.

advertisement | advertise on newsday

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 the All-Star Game for the 12th time 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 and 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, who received 473,579 votes, is a lock to compete in the Rising Stars Challenge during All-Star Weekend.

NBA videos

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.