A gay Barclays Center food server claims that Houston Rockets basketball players pelted him with homophobic slurs in a locker room before a 2013 game against the Nets — and that he was coldly canned by his catering company after he complained about the abuse, according to a Brooklyn federal lawsuit filed Tuesday.

Rasean Tate, 28, of Brooklyn, is suing the Rockets and the company that handles catering at Barclays, Levy Restaurant Holdings, for a slew of civil rights violations and anti-gay discrimination.

Tate claims that he was setting up a buffet in the visiting Rockets locker room before a game on Feb. 22, 2013, when he was all but chased from the area because he was gay.

“When the plaintiff’s back was turned to defendant Rockets players, he began to hear laughter and taunting voices saying ‘get this f—– out of here!’ ” according to the suit, and ” ‘He’s trying to catch a sneaky-peeky!’ ”

The reeling server said that the jabs and snickering didn’t let up.

“These series of comments were repeated a number of times by defendant Rockets players and staff,” according to the suit. “Plaintiff could hear defendant Rockets players overlapping voices and laughter.”

The suit does not name which individual players allegedly made the remarks.

Tate claims that a Nets representative witnessed the ugly incident and advised him to “just leave” and that he would “take care of it,” according to the suit.

Tate headed for the nearest restroom to compose himself, the suit says.

Still reeling two days later, Tate went to Levy catering manager Darcy Tarpia to relay details of the confrontation.

He was offered a verbal apology and promised that the situation would be addressed, according to the suit.

Tate was later told that Nets players were given special sensitivity training because of the incident with the Rockets, the court papers state.

But the suit alleges that he was soon met with retaliation rather than redress.

Tate claims he was slowly phased out of all locker room duty by the catering company after he lodged his complaints and his pay and hours plummeted as a result, according to the suit.

“This was solely in retaliation for his complaints about the harassment and discrimination he faced by defendant Rockets players and because of plaintiff’s sexual orientation,” the suit claims.

From the 2013 NBA Draft to the Jordan Brand Classic, Tate was suddenly barred from working locker rooms in favor of heterosexual staffers, the suit states.

With his pay falling off a cliff, Tate emailed Levy brass to assert his ability to work locker rooms like anyone else.

He stated in the missive that he was “able, capable and comfortable to perform any duty and task as a catering server in all locations of the arena, including locker rooms and dressing rooms, in spite of the incident that occurred earlier in the year.”

But Tate claims that his pleas led to further exile and he was barred from working the VIP area of the Video Music Awards in August 2013.

Tate claims that Levy brass violated their own policies when they assigned a female to work the dressing room of a male performer instead of him.

The suit argues that company policy normally dictates same-gender assignments for dressing rooms.

The pattern of retaliation finally resulted in Tate’s suspension in January for failing to give a customer a fork and other trumped-up offenses, his suit claims.

He was let go without pay — and hasn’t been called to work since, court papers allege.

“But for plaintiff’s sexual orientation and his complaints about harassment and discrimination based on his sexual orientation, defendants would not have retaliated against him and would not have treated him differently,” the suit states.

Lawyer Marjorie Mesidor blasted both the Rockets and the catering company for Tate’s allleged mistreatment.

“What happened to my client was deplorable,” she said. “It should not be tolerated by the Houston Rockets or Levy’s. What they needed to do was address his concerns, not retaliate against him for having the courage to speak up.”

Rockets forward Francisco Garcia, who played on the Rockets last year also, said, “I don’t remember anyone saying anything to anybody last year, so I don’t have any comment on that.”

The Barclays Center and the Nets are not parties to the suit.

A Barclays Center spokesman declined to comment on the suit.

The surging hoops team recently became the first squad to suit up an openly gay player when they signed Jason Collins in March.

Rockets and Levy reps did not immediately respond to requests for comment on the suit.

Additional reporting by Tim Bontemps