The last time the New York Yankees and the Washington Nationals met, it was June 2009, in the $1.5 billion splendor of the Yankees’ new stadium and the Nationals in the midst of a 103-loss season, their worst since baseball returned to the nation’s capital. In other words, despite the Nationals winning two of three games in that series, it really wasn’t about them at all.

Friday was Washington’s chance to show how much has changed. The teams lead their respective divisions, sport the second- and third-best records in the major leagues and the baseball world was watching as the old-guard Yankees began a weekend visit to the new-kid Nationals, who have shown this season that they, too, can be an attraction. This time, the spotlight shone on both teams.

The outcome wasn’t as the Nationals hoped — a deflating, 7-2 loss that snapped their six-game winning streak — but in the long view, situations like Friday’s were what they have been building toward since they returned to Washington eight years ago.

“We all love to play in those kind of atmospheres,” said third baseman Ryan Zimmerman, one of two current Nationals to have played in that 2009 series in the Bronx. “We haven’t had a chance to play in many of them in the seven years I’ve been here. But it’s always fun when you get to get out there and play in what I think playoff baseball would be like.”

The Nationals were competitive for much of the game thanks to a quality six-inning performance from effervescent starter Gio Gonzalez. Eventually, however, the Yankees’ strength, hitting, overmatched the Nationals’ forte, pitching. One key play in the decisive seventh inning provided a symbolic margin between the teams: a low throw to first base that missed by a foot.

“It wasn’t like we got crushed tonight,” shortstop Ian Desmond said. “The score probably says so, but we were in the game.”

Trailing 2-1, Gonzalez — brilliant (eight strikeouts) and inefficient (six full-count at-bats) all at once — was pulled for reliever Brad Lidge after allowing a single to Andruw Jones to lead off the seventh inning. From there, the game turned into a rout. The key blow: a one-out, bases-loaded infield single by Derek Jeter that, coupled with a throwing error by Desmond that skipped under first baseman Adam LaRoche’s glove, resulted in two runs. After left-hander Michael Gonzalez replaced Lidge, left-handed hitter Curtis Granderson doubled in two more runs, making the score 6-1.

“When I look back on it now, it’s kind of frustrating because all of a sudden you’re out of the game,” Lidge said.

With their youngest roster in years, the Nationals (38-24) have surprised many. They’ve beaten the Philadelphia Phillies, their bitter division rival, four of six times already this season. A week ago, they stormed into the historic grounds of Fenway Park and swept the Boston Red Sox, then swept Toronto for the franchise’s first 6-0 road trip since returning to Washington.

Slugger Michael Morse, his injury-shortened season made more frustrating by a slump, showed some promise. He finished 2 for 4 with a double, as well as a single in the third inning that trimmed the Nationals’ deficit to 2-1. For three more innings, that margin held.

Regardless of what happened on the field Friday night, the game was an event, a steppingstone for the franchise, as Zimmerman put it before the game. Gone, it seemed, were the times when the majority of fans that packed Nationals Park came in busloads or trains from Philadelphia or New York. Many of the announced sellout crowd of 41,406 rose to give a standing ovation for Gonzalez as he left the game in the seventh inning.

And while baseball in Washington has made many strides since its return in 2005, moments of Friday’s game revealed work was still needed. Yankees fans countered Gonzalez’s ovation just as loudly when standout second baseman Robinson Cano, who had been given the day off, pinch-hit in the seventh inning. The New York partisans followed that with an equally boisterous catcall when Cano was promptly intentionally walked. The fans that remained in the ninth also cheered as Granderson homered to extend the Yankees’ lead.

For six innings on Friday, the Nationals proved they had made strides as a franchise. It was the last three innings that showed there was still some room for improvement for this young team.

“You just can’t make mistakes against this club,” Washington Manager Davey Johnson said. “That’s a learning curve.”