Crystal Palace stunned Arsenal at Selhurst Park.
Townsend bagged the opener in the first-half, slotting home from Wilfred Zaha's cross.
Yohan Cabaye and Luka Milivojevic then added further goals to make it a miserable night for Arsene Wenger's side.
And Townsend has praised Palace and believes the impact of Allardyce, who replaced Alan Pardew in December, has saved them from relegation.
"We implemented Allardyce's tactics to a tee," he told Sky Sports.
Sam Allardyce masterminded Crystal Palace's win over Arsenal Arsenal player ratings against Crystal Palace Mon, April 10, 2017
Click through the gallery for the Arsenal player ratings against Crystal Palace
Play slideshow Getty Images 1 of 12
Click to reveal the Arsenal player ratings against Crystal Palace
"It was a great three points and a much needed three points.
"I think we need to get our heads back in the game and focus on Saturday.
"We lost focus after beating Chelsea.
"We will go in tomorrow and focus on Leicester this weekend.
"He has been incredible. I was on the wrong end of the Allardyce factor when he was at Sunderland and I went down with Newcastle, but he's working his magic again now."
Get Quotes on Home Insurance