Every disappointing NFL team can tell a story in which they aren’t as bad as they seem and the standings might show it with better luck. For the Falcons that narrative includes Matt Bryant’s missed extra point to tie in Arizona, Devonta Freeman’s goal-line fumble against Seattle and the three-sack surrender after the Saints tried to gift them a victory in Atlanta.

I was adding Kenjon Barner’s fumbled punt return to the what-if file on Sunday when the Falcons suddenly flipped the script. They would not squander a good effort with fatal miscues. Instead, the Falcons overcame their errors with a furious rally to score the decisive points in the final seconds--twice.

It appeared the Falcons won when Austin Hooper corralled Matt Ryan’s pass in the end zone with five seconds left. That call was reversed by replay officials. Then game officials ruled the Julio Jones came up a yard short of a TD with one second to go. That call was reversed, too.

Touchdown, Falcons.

“That was awesome,” Falcons coach Dan Quinn said.

It was that for the Falcons, who beat the NFC’s best team. The 49ers (11-3) were favored by 10 points and led 19-10 with 10 minutes to go. They lost 29-22, with the Falcons adding a fumble return TD on the kickoff following Jones’ score.

“This was a glimpse of what we could have been,” Falcons linebacker De’Vondre Campbell said.

The Falcons (5-9) are not a playoff team. The postseason was a long shot once they lost seven of their first eight games. They were officially eliminated when Saints beat them on Thanksgiving Day.

But the Falcons are a better team. They’ve won four of six games since their bye week, including three straight on the road. The Falcons beat two of the top teams in the NFC, San Francisco and New Orleans, on their home turf.

“I wish we could have popped it off like this a little earlier in the season, but I’m not going to complain now,” Falcons safety Ricardo Allen said.

Now was the time for the Falcons to celebrate. Players and coaches ran wild on the field when referee Craig Wrolstad announced the replay ruling on Jones’ touchdown. The party was still going in their locker room afterwards.

Coach Dan Quinn was beaming long after the final whistle.

“At the end, game on the line, those are the moments as a coach that you totally live for,” Quinn said. “It makes you feel most alive. It was awesome.”

The 49ers are coached by Quinn’s former offensive coordinator, Kyle Shanahan. The Falcons have steadily declined those two helped them get to the Super Bowl. Shanahan has the 49ers headed to the playoffs in Year 3 while Quinn’s job security is uncertain. But Quinn’s Falcons bested the 49ers with a plucky defensive effort and big plays from Jones, who had 134 yards on 13 catches.

It wasn’t easy for the Falcons, in part because they made it harder. The Falcons had 11 penalties for 98 yards. They played the 49ers even for a half and then ran in place with a series of blunders after halftime.

Foyesade Oluokon recovered an on-side kick for the Falcons to begin the second half but an illegal formation penalty wiped out the play. The 49ers ran four plays before punting and Barner returned it 57 yards but a block in the back penalty turned it into a three-yard loss. At least those mistakes didn’t cost the Falcons points.

Barner’s fumbled punt return did. Kyle Juszczyk scooped it up and at the 17-yard line and ran to the one-yard line. The 49ers scored two plays later for the 19-10 advantage.

The Falcons kept coming. On their next drive Jones converted two third downs and drew a pass interference penalty in the end zone. That put the ball at the one-yard line and Qadree Ollison scored on the next play.

The Falcons were back in business, down 19-17 with 5:20 to go. They seemed sunk after the 49ers chewed up clock and kicked a field goal with less than two minutes left. But the Falcons continued to leverage their best asset, Ryan to Jones.

Jones’ 25-yard catch-and-run put the Falcons at San Francisco’s 24-yard line. His 10-yard catch went to the five-yard line. After officials took away Hooper’s game-winner, Jones delivered again.

Hooper ran a route that took out one defender. Jones crossed underneath Hooper and caught the ball just as safety Jimmie Ward hit him low. Jones cradled the ball and leaned backwards to get just enough of it over the goal line.

“That’s what you do when the game is on the line, you give it to to your best,” Allen said.

The Falcons couldn’t gain traction running against San Francisco’s injury-depleted front. They still were able to leverage their greatest strength, Ryan to Jones.

That combo produced 48 yards on the game-tying touchdown drive in the first quarter. Jones had three catches to convert third downs on that drive and finished it with a five-yard TD catch, his first since Week 3 at Indianapolis. The Falcons won on Jones’ second TD catch of the game.

The Falcons fouled up plenty but they never folded.

“Records aren’t indicative of what a team is made of,” Hopper said. “We’ve got a lot of fight, we’ve got a lot of grit, we’ve got a lot of talent on this team. Just because we messed it up in the past doesn’t mean we have to mess it up all the way. You guys are starting to see what we can do.”

It makes me wonder what might have been for the Falcons.