Vitaly Janelt had blasted the Bees in front against the run of play midway through the first half.
Fulham were frustrated until added time when substitute Wilson flicked home the equaliser and then head in a winner at the death.
"It was an amazing feeling to come on and get the two goals to win the game. We deserved it, we kept them pinned in throughout," said Wilson.
Victory lifts Marco Silva's men up to ninth and just three points off the top four.
Brentford had been headed for the top half themselves until the late turnaround, but instead remain in 12th.
Fulham failed to make the most of a purposeful start as Reiss Nelson was denied by Mark Flekken.
Brentford had barely threatened prior to going in front on 24 minutes when Janelt took aim from distance and fired a blistering shot past Bernd Leno.
Emile Smith Rowe wasted a big chance to reply immediately and the home side struggled to break through Brentford's mass ranks of defence after half-time.
It took until Fulham's 25th attempt on goal to beat Flekken, as Wilson's inventive effort looped over the Dutch goalkeeper from Adama Traore's cross.
Moments later, the Welsh international had a fortuitous second.
Wilson's attempted header came off his shoulder to wrong-foot Flekken and flew into the top corner.
"They both went in but not how I would have wanted!" Wilson added.
"The first one I just helped it on to the back post and the second one was more lucky.
"I was trying to head it into the other corner but it hit my shoulder and went in."