You can swap a motor that came in a newer model of your car into your older car. You still have to have all the smog equipment from that engine intact, and they base the test results off the smog specs from the motor you swaped in. If you tell them you have swaped the motor from a 95 cobra R into your car it should be legal as long as your car is a 95 or newer. You will have to use the correct cobra intake and every performance part will have to have a carb number that specifys use on a 95 cobra R, which I dont think there are very many. Most of the stuff you would use on a 5.0 wouldnt be legal on a 351. Also I wouldnt even bother taking that to a smog shop, I would go straight to a referee so you dont end up wasting any money at a shop. I wouldnt do it if I were you, I would build a 331 and call it good cause no smog tech is going to be able to tell you did it.