EAST RUTHERFORD, N.J. — Questionable penalty calls, a great audible by Eli Manning, a dazzling 66-yard catch and run by Odell Beckham Jr., and a last-second pass knocked down in the end zone.

That was just some of the wackiness Sunday at MetLife Stadium.

The struggling New York Giants and Baltimore Ravens came into Sunday’s game at MetLife Stadium riding losing streaks and not playing their best on offense. Not much was expected.

Then, the last two minutes were as exciting as they can get in New York’s 27-23 win.

The Giants (3-3) lost the lead with 2:04 to play, regained it 40 seconds later on the 66-yard catch and run by Beckham, then held off a last-ditch Ravens drive that reached the 24-yard line thanks, in part, to a debatable roughing- the-passer call on a fourth-down incompletion that should have sealed New York’s win.

“This was huge,” Giants receiver Victor Cruz said after they snapped a three-game losing streak. “These wins are ones that we have to continue to mount up to stay in the conversation and continue to compete in the division, but also the entire league.”

The Giants saw their chances of winning damaged by referee Jeff Triplette and his crew twice in the final minutes.

Baltimore took the lead after cornerback Dominique Rodgers-Cromartie was called for pass interference at the 8-yard line. On the play, both he and receiver Breshad Perriman were looking back for the ball. If anything, Perriman seemed to interfere with the defender.

The call went the other way, and Terrance West scored from 2 yards three plays later to give the Ravens a 23-20 lead.

Rodgers-Cromartie refused to criticize the call that another teammate, who didn’t want to be identified because of fine possibilities, called “horrible.”

“I’m fighting with him and he’s looking at the ball. That’s legal,” Rodgers-Cromartie said, adding he did not argue because that’s the way he is.

Facing a fourth straight loss, the Giants rallied. They needed only four plays to retake lead, with Beckham and Manning connecting on that clutch 66-yard slant on fourth-and-1.

Manning came to the line and saw the Ravens playing man-to-man defense. He changed the play to go to Beckham, who earlier caught a 75-yard TD pass and finished with eight catches for a career-best 222 yards.

“He did a good job of beating the guy and making him fall down,” said Manning, who threw for 403 yards. “You hit him in stride and good things happen.”

Beckham almost cost the Giants, though, which seemed fitting considering the wild nature of the final minutes. After scoring with 1:24 to play, he took off his helmet and was assessed a 15-yard penalty.

The Ravens got the ball back at their 32 and Joe Flacco immediately hit passes of 13 and 11 yards. On fourth-and-5 from the New York 39, Flacco threw an incompletion, but drew a late-hit call on Owa Odighizuwa, giving Baltimore a first down at the Giants 24 with 15 seconds to play.

Rodgers-Cromartie defended Mike Wallace on two passes and Flacco’s pass into the end zone to Dennis Pitta was knocked down.

It was the 20th time in 22 games that the Ravens’ outcome was decided by eight points or less.

“We’re a .500 team,” Baltimore safety Eric Weddle said. “We are 3 and 3 in tight games. We’ve won some, we’ve lost some. We could easily say we could be 5 and 1. Or we could be 0 and 6. It’s a long season. It’s about being consistent.”

It’s been exciting, though, as the Giants found out seeing Beckham save their day with his last touchdown.

“Listen man, to sit back as a player and just watch that, it’s amazing, man,” Rodgers-Cromartie said of Beckham, who left the game in the first half with a hip pointer. “He gives you boost that you need as a defense to say, ‘Man, this guy here is out here on fire.’ . So you go out there (as a defense) with a little swag not to let them in.”

AP NFL website: www.pro32.ap.org and www.twitter.com/AP_NFL