The given AP is 2, 7, 12, ..., 47.
Let us re-write the given AP in reverse order i.e. 47, 42, .., 12, 7, 2.
Now, the 5th term from the end of the given AP is equal to the 5th term from beginning of the AP 47, 42,.... ,12, 7, 2.
Consider the AP 47, 42,..., 12, 7, 2.
Hence, the 5th term from the end of the given AP is 27.