The Giants scored their biggest win in years by landing their No. 1 target: John Harbaugh is expected to be New York’s next head coach.

Harbaugh, 63, agreed late Wednesday night to coach the Giants, and the two parties were working Thursday to finalize an agreement to make it official, a source told the Daily News.

The longtime Baltimore Ravens coach reportedly will receive a contract in the neighborhood of five years and $100 million. That’s worth every penny to the Giants, a franchise with four Super Bowls desperate to reclaim the glory of its distant past.

“It’s a home run hire for the Giants,” Super Bowl champion Chris Canty, a former Giant who played for Harbaugh in Baltimore, told The News. “Harbs will bring a level of discipline and accountability that has been missing since Tom Coughlin.”

Coughlin led the Giants to Super Bowls in 2007 and 2011, but the Giants have been to the playoffs only twice in the 12 seasons since they last lifted the Lombardi Trophy.

So they knew the stakes when they hosted Harbaugh at the Giants’ facility in East Rutherford, N.J., all day Wednesday. And they brought him to nearby Elia Mediterranean Restaurant to close the deal in a private room with a Giants contingent that included executive Chris Mara, director of player personnel Tim McDonnell and GM Joe Schoen.

John Harbaugh and Giants brass met inside a private room at Elia Mediterranean Restaurant.John Harbaugh and Giants brass met inside a private room at Elia Mediterranean Restaurant.

The wine flowed, and so did the excitement. It became clear that Harbaugh felt comfortable enough at Tim Salouros’ restaurant for the owner to crack a joke.

“I said, ‘As a fan, coach, are you ready to join the Giants? Or else we won’t let you leave the building,’” Salouros told The News on Thursday with a laugh.

Harbaugh dined on a pan-roasted Alaskan filet of Halibut over cauliflower, spinach, asparagus, mushrooms and crab meat, finished with a yellow romesco purée.

He and the Giants’ brass also sampled appetizers from fried calamari and shrimp to octopus, zucchini and eggplant chips, Greek salad and a fried Saganaki cheese.

Harbaugh still flew home from Teterboro Airport to the Baltimore area on Wednesday evening, but he knew New York was where he wanted to be.

He cancelled a planned Thursday visit from the Tennessee Titans in anticipation of closing the deal with the Giants on Thursday, and that took the biggest name on this year’s coaching carousel off the board.

Harbaugh, who won a Super Bowl in 2012 and built a career .614 winning percentage during 18 seasons in Baltimore, instantly restores credibility and professionalism to a Giants franchise that has lost its way.

The Giants knew they needed to make a big hire. Schoen promised a sweeping search that would turn over every rock. And he interviewed several candidates, from former Cleveland Browns head coach Kevin Stefanski to Denver Broncos special teams coordinator Darren Rizzi.

But once the Ravens fired Harbaugh last week, the Giants went all-out for one man.

Chris Mara, who has stepped into a larger role during co-owner John Mara’s cancer battle, visited Harbaugh at his house last weekend to set the table for the coach’s visit to New Jersey. The Giants leaked tons of information about their heavy pursuit of Harbaugh to thrust their pursuit into the spotlight.

And Harbaugh appreciated the love.

The big questions now are what Schoen’s role will be with Harbaugh as head coach, how this benefits Jaxson Dart and what significant changes Harbaugh will bring to the organization.

Sources had told The News during the process that they expected Harbaugh would either want Schoen out of the picture or that he would reduce Schoen’s role significantly in a more head coach-centric structure.

Early indications are that Schoen and Harbaugh got along extremely well during the Giants’ courtship and that the GM will be retained after showing as much enthusiasm as anyone for this hire.

So it remains to be seen how drastically the balance of power will change, with Harbaugh expected to have a strong voice in personnel.

All the same, Schoen stays.

Dart, who met with Harbaugh on Wednesday, may end up being one of the biggest beneficiaries of this hire since Harbaugh is expected to bring Ravens offensive coordinator Todd Monken with him.

Broncos quarterback coach Davis Webb and Rams passing game coordinator Nate Scheelhaase were two names that intrigued the Giants as potential coordinators during this search, as well. But Monken’s alignment with Harbaugh and historic production with Lamar Jackson bode well for Dart’s potential as a dual-threat quarterback entering his second NFL season.

As far as relating to players, Harbaugh is viewed as a culture builder who knows how to point the entire team in one direction. And that’s something the Giants have needed badly for a long time.

Connecting with the Giants’ young core of Dart, Abdul Carter, Malik Nabers and Cam Skattebo will be important for the veteran coach to set a new tone on how he will manage this eager roster.

“It’s my hope that Harbs adjusts to this generation of athlete, empowering them more, giving them more ownership of the team,” said Canty, who played for Harbaugh from 2013-15. “Not an easy balance to achieve, but if anyone is capable of doing it, it’s John.”

Defensively, a reunion with Wink Martindale would make a lot of sense. Harbaugh and Martindale have great respect for each other.

They ran a top three scoring defense in the NFL for three straight years together in Baltimore from 2018-20. And Martindale was a catalyst of the Giants’ 2022 playoff team in his first of two years as the Giants’ defensive coordinator before he left for the University of Michigan.

Miami Dolphins defensive coordinator Anthony Weaver, a former Ravens defensive line coach under Harbaugh, also is a name to watch. And interim Giants defensive coordinator Charlie Bullen is a close friend of Schoen’s and well-regarded in the building.

Then there are the big picture ramifications of what Harbaugh’s hiring internally will mean for the rest of the building.

This is an experienced coach who knows what works. That could mean shaking up the organization and turning over some departments that haven’t been touched or held accountable for a long time.

The Giants seemed to understand how badly they needed major change, though, when they went all out to get Harbaugh.

They know they have a 44-104-1 (.295) record and one playoff appearance since the start of the 2017 season. They know how far below their standard that is.

Landing Harbaugh could be their first big win of many in their quest to get back on track.