The loss by Washington (6-5-1) clinched a playoff spot for the 11-1 Dallas Cowboys.
Palmer's 25-yard touchdown pass to Johnson with 11:09 to play put Arizona ahead 24-20, the fourth lead change of the second half.
After a Washington field goal, Palmer's 42-yard touchdown pass to J.J. Nelson with 1:56 padded gave the Cardinals (5-6-1) a 31-23 lead.
Johnson, who also scored on a 1-yard run, became the second player in NFL history to top 100 yards from scrimmage in the first 12 games of a season. Edgerrin James was the other.
Johnson carried the ball 18 times for 84 yards and caught nine passes for another 91.
Larry Fitzgerald caught 10 passes for 78 yards, moving past Cris Carter into third on the NFL career receptions list.
Cousins completed 21 of 37 passes for 271 yards and a touchdown. His 59-yard pass to DeSean Jackson on the first series of the second half set up his 1-yard touchdown sneak.
That gave Arizona a 17-13 lead. Washington came right back. Cousins threw to a wide-open Jamison Crowder on a 26-yard touchdown play to put Washington back on top, 20-17, with 1:06 left in the third quarter.
The Cardinals avoided what would have been the team's first three-game losing streak since coach Bruce Arians came to the desert four seasons ago.
Washington center Spencer Long left the game early to be evaluated for a concussion and did not return.
Washington: Washington returns to NFC East play with a game at Philadelphia next on Sunday.
Cardinals: Arizona travels across the country to face Miami on Sunday.