While a generic answer, yes, it is possible. And legally with emissions laws I believe the engine must be same year or newer. But practically, as long as same generation of ECU/harness, probably not.
It would be far more trouble than it's worth, and more expensive than it's worth. If you want more power but you don't want to go into more debt, add a RIPP supercharger or a twin turbo kit. If you want that V8 rumble, upgrade to a V8 car. Don't sleep on the 5.7 R/T either, they're underrated and under tuned from the factory and they really come alive with some fairly simple mods and tuning. And 2019's and up come stock with the Super Track Pak package, which includes better suspension. If you want a lot more power AND that V8 rumble, snag yourself a low mileage used Scat Pack in the low 30's.