What about
auto iter = find( a.rbegin(), a.rend(), 5);
?
Try
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
vector<int>a = {5,1,2,3,5,4,5,6 };
auto iter = find( a.rbegin(), a.rend(), 5);
if ( (iter != a.rend())) std::cout << "found at position " << (a.rend() - iter- 1 ) << endl;
}