Cavan snatched promotion to Division 1 out of 14-man Tipperary's hands with two points in injury-time at Breffni Park.
When Conor Sweeney put Liam Kearns' side ahead in the closing stages, Tipp were set to go to Down next week needing only to avoid a heavy defeat to go up.
But Gearoid McKiernan and sub, Conor Madden, struck to send Cavan back to the top tier at the first attempt.
Tipp had led for the majority of the game, with Sweeney netting from the penalty spot in the 14th minute. It was 1-5 to 0-6 at the break.
Tipp suffered an early second-half blow when Liam Casey was shown the line for a high tackle and Cavan were soon level.
But Liam McGrath goalled to put Tipp back in the driving seat and they were four clear when Sweeney pointed again.
But they couldn't hang on and Cavan reeled them in with four in a row as Tipp squandered opportunities.
Sweeney had Tipp in front again before the high drama at the death.
Cavan now join Roscommon back in Division 1, both last year's relegated sides bouncing back swiftly.
Elsewhere in Division 2, Meath beat Down at Pairc Tailteann by 4-14 to 1-14 to keep their survival hopes alive, while Clare beat Louth 3-12 to 1-11 at Cusack Park.