NEW YORK — With so much on the line, the Flyers should have been playing like a desperate team Tuesday night against the lowly New York Islanders at the Barclays Center.

Instead, they went through the motions for most of the first 40 minutes before awaking in the third period. They got a pair of power-play goals from coming-of-age rookie Nolan Patrick and a tally from Claude Giroux to overcome a 4-1 deficit and tie the score at 4-all.

No matter.

Speedy rookie Mathew Barzal got behind Jori Lehtera and scored on a breakaway with 6:28 left, steering the Islanders to a wild 5-4 victory.

"We didn't play well. They won more battles, which is inexcusable at this time of the year," center Sean Couturier said. "The first 40 [minutes] weren't good at all."

"We were flat. We weren't playing our systems and we had no jump to start the game," Patrick said after the first two-goal game of his career. "It's not really acceptable."

On Barzal's goal, his second of the night, defenseman Ivan Provorov pinched into the offensive end, and the Islanders broke out on an odd-man rush.

Summary NHL scores | Standings

It was a microcosm of the Flyers' roller-coaster-ride of a season, a year in which they have played up or down to their competition at an alarming rate.

Two nights after they beat best-in-the-Eastern Conference Boston in overtime, the Flyers played with no urgency in the first two periods as they fell to an Islanders team that is at the bottom of the Metropolitan standings.

Metropolitan Division GR Pts.
y-Washington 2 103
x-Pittsburgh 2 96
Columbus 2 96
New Jersey 2 95
Flyers 2 94
Wild-card GR Pts.
7. New Jersey 2 95
8. Flyers 2 94
Florida 3 90
GR: Games remaining
x: Clinched playoff berth
y: Clinched division

John Tavares scored a pair of goals for the Islanders, who had lost eight of their last 10 and 16 of their last 19 (3-12-4) — and had been eliminated from playoff contention eight nights earlier.

Patrick, who took Wayne Simmonds' spot on the top power-play unit, reached a rebound with a diving effort in front and knocked in his 12th goal, getting the Flyers to within 4-2 with 15:53 to go in regulation.

With 11:44 remaining, Patrick tipped in Jake Voracek's drive, cutting the deficit to 4-3.

The Flyers, who have played admirably for most of the last four months and have overcome a disastrous start, are on the verge of clinching a playoff berth. And they need points if they want to climb to second in the Metro and get home-ice advantage in the first playoff round.

But Tuesday's loss — they won just one of four games against the Isles, the league's worst defensive team — may have them readjusting their goals.

As in: Just get in the playoffs.

The Flyers fell into the second and last wild-card spot. They could have moved into a virtual second-place tie with Pittsburgh with a victory.

With two regular-season games left (Carolina and the Rangers), the Flyers' magic number is three points — the combined total of points they gain or Florida fails to secure — to clinch a playoff spot. Florida outlasted Nashville, 2-1, on Tuesday.

"We're almost in the playoffs, but we can't take the foot off the gas pedal," said Couturier, whose team, provided they do make the playoffs, may have to face a tougher first-round opponent because of Tuesday's defeat. "There aren't going to be any easy games."

At one point Tuesday, the Islanders had three second-period goals while the Flyers had three shots in the stanza.

The Isles had 14 of the first 16 shots in the second period en route to pulling away from a 1-1 tie.

Anthony Beauvillier scored from the high slot to give the Islanders a 2-1 lead with 16:17 to go in the second.

Tavares' second goal of the night, on his own rebound, made it 3-1 with 8:54 remaining in the second.

"I lost the puck there a little bit," said losing goalie Mrazek, who has been inconsistent since being acquired from Detroit. "I tried to kick it out as hard as I could, and I think I kicked it right on his stick."

About five minutes later, Barzal made a dazzling move to shake free from Wayne Simmonds and beat Mrazek with a high shot to put the hosts ahead, 4-1.

In the first period, Simmonds, finishing off a slick passing play between Shayne Gostisbehere, Oskar Lindblom and Patrick (primary assist), scored from the right circle to tie the game at 1-1 with 53 seconds left in the stanza.

The Islanders had taken a 1-0 lead on Tavares' 35th goal, scored 10 seconds into a power play.

After Radko Gudas failed to clear the puck, Barzal (two goals, three points) found Tavares in the left circle and he whipped a shot through the legs of Mrazek with 12:45 to go in the first.

No one in the Flyers' locker room could explain their penchant for struggling against poor teams.

"For some reason, we  don't play as well as we want to in the first couple periods" against weak teams, Provorov said. "We just give them the momentum and the puck."

That needs to change in the final two games against non-playoff teams Carolina and the Rangers.