After getting knocked out of the U.S. Open Cup in consecutive years by Philadelphia, the Red Bulls are hoping the third time’s the charm.

They play host to the Union on Wednesday at 8 p.m. in the Open Cup Round of 16. It’s a chance to get payback in an increasingly testy rivalry and get within three victories of a championship they’ve never won.

“It’s really important. It’s a trophy this club’s never won, it’s a chance to win a trophy,’’ said coach Jesse Marsch, who was ejected from last year’s game. “We think it’s a great opportunity to play this game at home, to get to the quarterfinals, to get revenge for the last two years, to continue to find a way to push forward.”

It’s also a chance to get right back on the horse after a galling loss to New York City FC on Saturday, their first ever at home to their rivals. While D.C. United and now NYCFC have been the Red Bulls’ most hated rivals, this I-95 derby has meant more to Philadelphia. But still seething over last weekend — and the past two Open Cups — should have the Red Bulls properly incentivized.

“It’s a perfect match to have at this moment,” Marsch said. “We know we came in second in a lot of categories in the game against City, so [there is] nothing better than a big game against a team that’s knocked us out twice two years in a row. So it doesn’t take much reminding about what this game means for us. And we have to be up for it in every way.”

The Red Bulls won 2-0 at Philadelphia in their most recent meeting. Striker Bradley Wright-Phillips scored both goals, and has seven in 10 league games against the Union. Wednesday’s game will be in Harrison, N.J., and the Red Bulls have seen firsthand how dangerous the Union can be when they come on the road, sit back and counter their way to a late winner.

“Now we’re playing at home, we know that there will be a different flow to the game. We’ll be able to dictate things more, but it also makes them more dangerous because they’re good on the counter,’’ Marsch said. “We have to just be up for a big challenge and make sure we understand what the game is going to look like.”

Midfielder Mike Grella is hurt, and captain Sacha Kljestan — though he leads MLS in chances created (106), according to Opta — is coming off a poor game. For a Red Bulls team playing its fourth game in 14 days, he’ll need to regain his form.

“I know that Sacha has frustration about how the last game went. … He was the first to say he didn’t play well and he wasn’t happy with the performance. That’s the best thing about Sacha, he doesn’t hide from responsibility,” Marsch said. “We’ll find a way to keep using him in ways that feed to his strengths.”

Wednesday’s winner plays either D.C. or New England in the quarterfinals, which take place from July 7-16. The Red Bulls have reached the finals just once, losing to Chicago in Giants Stadium in 2003.